@@ -51,8 +51,16 @@ protected void message(char[] chars, int length) {
5151 public void testSerialUTF8Decoder () throws Exception {
5252 NullSerial s = new NullSerial ();
5353 // 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 );
5765 }
5866}
0 commit comments