340 for (
const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
341 for (
unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
354 unsigned decodedCodepoint = 0;
357 for (
const char* s = utf8os.
GetString(); *s; ++s) {
358 if (!decode(&
state, &decodedCodepoint, static_cast<unsigned char>(*s)))
362 if (codepoint <= 0xFFFF)
366 *p++ =
static_cast<UTF16<>::Ch>(0xD7C0 + (decodedCodepoint >> 10));
367 *p++ =
static_cast<UTF16<>::Ch>(0xDC00 + (decodedCodepoint & 0x3FF));
377 unsigned decodedCodepoint;
381 if (!result || codepoint != decodedCodepoint)
382 std::cout << std::hex << codepoint <<
" " << decodedCodepoint << std::endl;
static void Encode(OutputStream &os, unsigned codepoint)
Represents an in-memory output stream.
#define EXPECT_TRUE(condition)
static bool Validate(InputStream &is, OutputStream &os)
static void Encode(OutputStream &os, unsigned codepoint)
int StrCmp(const Ch *s1, const Ch *s2)
const Ch * GetString() const
static bool Decode(InputStream &is, unsigned *codepoint)
#define EXPECT_EQ(val1, val2)