Go to the source code of this file.
◆ UTF8_ACCEPT
◆ TEST() [1/4]
| TEST |
( |
EncodingsTest |
, |
|
|
ASCII |
|
|
) |
| |
Definition at line 428 of file encodingstest.cpp.
430 for (
unsigned codepoint = 0; codepoint < 128; codepoint++) {
436 unsigned decodedCodepoint;
438 if (!result || codepoint != decodedCodepoint)
439 std::cout << std::hex << codepoint <<
" " << decodedCodepoint << std::endl;
const Ch * GetString() const
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
static bool Validate(InputStream &is, OutputStream &os)
static bool Decode(InputStream &is, unsigned *codepoint)
static void Encode(OutputStream &os, unsigned codepoint)
int StrCmp(const Ch *s1, const Ch *s2)
◆ TEST() [2/4]
| TEST |
( |
EncodingsTest |
, |
|
|
UTF16 |
|
|
) |
| |
Definition at line 337 of file encodingstest.cpp.
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 bool Decode(InputStream &is, unsigned *codepoint)
static bool Validate(InputStream &is, OutputStream &os)
static void Encode(OutputStream &os, unsigned codepoint)
static void Encode(OutputStream &os, unsigned codepoint)
◆ TEST() [3/4]
| TEST |
( |
EncodingsTest |
, |
|
|
UTF32 |
|
|
) |
| |
Definition at line 397 of file encodingstest.cpp.
399 for (
const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
400 for (
unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
408 unsigned decodedCodepoint;
412 if (!result || codepoint != decodedCodepoint)
413 std::cout << std::hex << codepoint <<
" " << decodedCodepoint << std::endl;
static void Encode(OutputStream &os, unsigned codepoint)
static bool Decode(InputStream &is, unsigned *codepoint)
static bool Validate(InputStream &is, OutputStream &os)
◆ TEST() [4/4]
| TEST |
( |
EncodingsTest |
, |
|
|
UTF8 |
|
|
) |
| |
Definition at line 285 of file encodingstest.cpp.
287 for (
const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
288 for (
unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
295 unsigned decodedCodepoint = 0;
298 unsigned decodedCount = 0;
299 for (
const char* s = encodedStr; *s; ++s)
300 if (!decode(&
state, &decodedCodepoint,
static_cast<unsigned char>(*s))) {
311 std::cout << std::hex << codepoint <<
" " << decodedCodepoint << std::endl;
317 unsigned decodedCodepoint;
321 if (!result || codepoint != decodedCodepoint)
322 std::cout << std::hex << codepoint <<
" " << decodedCodepoint << std::endl;
static bool Decode(InputStream &is, unsigned *codepoint)
static bool Validate(InputStream &is, OutputStream &os)