@@ -51,8 +51,16 @@ protected void message(char[] chars, int length) {
51
51
public void testSerialUTF8Decoder () throws Exception {
52
52
NullSerial s = new NullSerial ();
53
53
// https://github.com/arduino/Arduino/issues/9808
54
- String testdata = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789°0123456789" ;
55
- s .processSerialEvent (testdata .getBytes ());
56
- assertEquals (s .output , testdata );
54
+ byte testData [] = { 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 ,
55
+ 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 ,
56
+ 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 ,
57
+ 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 ,
58
+ 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 ,
59
+ 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 ,
60
+ 52 , 53 , 54 , 55 , 56 , 57 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , //
61
+ -62 , -80 , // UTF8 char
62
+ 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 };
63
+ s .processSerialEvent (testData );
64
+ assertEquals (new String (testData , "UTF-8" ), s .output );
57
65
}
58
66
}
0 commit comments