Public Member Functions | |
void | testIsValidUtf8_1Byte () |
void | testIsValidUtf8_2Bytes () |
void | testIsValidUtf8_3Bytes () |
void | testIsValidUtf8_4BytesSamples () |
void | testShardsHaveExpectedRoundTrippables () |
void | testSomeSequences () |
Private Member Functions | |
void | assertInvalidUtf8 (int... bytes) |
void | assertValidUtf8 (ByteStringFactory factory, int[] bytes, boolean not) |
void | assertValidUtf8 (int... bytes) |
byte[] | toByteArray (int... bytes) |
Static Private Member Functions | |
static ByteString | asBytes (String s) |
Tests cases for ByteString#isValidUtf8(). This includes three brute force tests that actually test every permutation of one byte, two byte, and three byte sequences to ensure that the method produces the right result for every possible byte encoding where "right" means it's consistent with java's UTF-8 string encoding/decoding such that the method returns true for any sequence that will round trip when converted to a String and then back to bytes and will return false for any sequence that will not round trip. See also IsValidUtf8FourByteTest. It also includes some other more targeted tests.
Definition at line 56 of file IsValidUtf8Test.java.
|
inlinestaticprivate |
Definition at line 163 of file IsValidUtf8Test.java.
|
inlineprivate |
Definition at line 157 of file IsValidUtf8Test.java.
|
inlineprivate |
Definition at line 131 of file IsValidUtf8Test.java.
|
inlineprivate |
Definition at line 151 of file IsValidUtf8Test.java.
|
inline |
Tests that round tripping of all two byte permutations work.
Definition at line 58 of file IsValidUtf8Test.java.
|
inline |
Tests that round tripping of all two byte permutations work.
Definition at line 65 of file IsValidUtf8Test.java.
|
inline |
Tests that round tripping of all three byte permutations work.
Definition at line 72 of file IsValidUtf8Test.java.
|
inline |
Tests that round tripping of a sample of four byte permutations work. All permutations are prohibitively expensive to test for automated runs; IsValidUtf8FourByteTest is used for full coverage. This method tests specific four-byte cases.
Definition at line 86 of file IsValidUtf8Test.java.
|
inline |
Definition at line 167 of file IsValidUtf8Test.java.
|
inline |
Tests some hard-coded test cases.
Definition at line 100 of file IsValidUtf8Test.java.
|
inlineprivate |
Definition at line 123 of file IsValidUtf8Test.java.