Skip to content

Bugfixes on tests and github actions runner for Windows #10196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed SerialTest on Windows
It looks like that on Windows string builders use a default encoding that
is different from UTF-8.
  • Loading branch information
cmaglie committed Jun 19, 2020
commit 24bf3eb348dcc31763de6919173b69ec2ced6c77
14 changes: 11 additions & 3 deletions app/test/processing/app/SerialTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ protected void message(char[] chars, int length) {
public void testSerialUTF8Decoder() throws Exception {
NullSerial s = new NullSerial();
// https://github.com/arduino/Arduino/issues/9808
String testdata = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789°0123456789";
s.processSerialEvent(testdata.getBytes());
assertEquals(s.output, testdata);
byte testData[] = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, //
-62, -80, // UTF8 char
48, 49, 50, 51, 52, 53, 54, 55, 56, 57 };
s.processSerialEvent(testData);
assertEquals(new String(testData, "UTF-8"), s.output);
}
}