MCPcopy Create free account
hub / github.com/boostorg/json / testClassifyUtf8

Method testClassifyUtf8

test/utf8.cpp:51–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 }
50
51 void
52 testClassifyUtf8()
53 {
54 BOOST_TEST((detail::classify_utf8('\x00') & 0xFF) == 0);
55 // from code point U+0080 (0xC280 in UTF-8)
56 BOOST_TEST((detail::classify_utf8('\xC2') & 0xFF) == 2);
57 // from code point U+07FF (0xDFBF in UTF-8)
58 BOOST_TEST((detail::classify_utf8('\xDF') & 0xFF) == 2);
59 // from code point U+0800 (0xE0A080 in UTF-8)
60 BOOST_TEST((detail::classify_utf8('\xE0') & 0xFF) == 3);
61 // from code point U+0FFFF (0xEFBFBF in UTF-8)
62 BOOST_TEST((detail::classify_utf8('\xEF') & 0xFF) == 3);
63 // from code point U+010000 (0xF0908080 in UTF-8)
64 BOOST_TEST((detail::classify_utf8('\xF0') & 0xFF) == 4);
65 // from code point U+010000 (0xF0908080 in UTF-8)
66 BOOST_TEST((detail::classify_utf8('\xF0') & 0xFF) == 4);
67 // from code point U+010FFFF (0xF48FBFBF in UTF-8)
68 BOOST_TEST((detail::classify_utf8('\xF4') & 0xFF) == 4);
69 }
70
71 void
72 testIsValidUtf8()

Callers

nothing calls this directly

Calls 1

classify_utf8Function · 0.85

Tested by

no test coverage detected