mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Remove unescaped Unicode from tests. #218
This commit is contained in:
@@ -12,7 +12,6 @@ import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class BdfReaderImplTest extends BriarTestCase {
|
||||
|
||||
@@ -260,14 +259,13 @@ public class BdfReaderImplTest extends BriarTestCase {
|
||||
|
||||
@Test
|
||||
public void testReadUtf8String() throws Exception {
|
||||
String str = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \uFDD0\uFDD1\uFDD2\uFDD3\uFDD1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
String strHex = StringUtils.toHexString(str.getBytes("UTF-8"));
|
||||
String unicode = "\uFDD0\uFDD1\uFDD2\uFDD3";
|
||||
String hex = StringUtils.toHexString(unicode.getBytes("UTF-8"));
|
||||
// STRING_8 tag, "foo", the empty string, and the test string
|
||||
setContents("41" + "03" + "666F6F" + "41" + "00" +
|
||||
"41" + "35" + strHex);
|
||||
setContents("41" + "03" + "666F6F" +"41" + "00" + "41" + "0C" + hex);
|
||||
assertEquals("foo", r.readString(Integer.MAX_VALUE));
|
||||
assertEquals("", r.readString(Integer.MAX_VALUE));
|
||||
assertEquals(str, r.readString(Integer.MAX_VALUE));
|
||||
assertEquals(unicode, r.readString(Integer.MAX_VALUE));
|
||||
assertTrue(r.eof());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user