MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / test_32_8_roundtrip

Function test_32_8_roundtrip

tests/test_unicode.cpp:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace OpenApoc;
6
7static bool test_32_8_roundtrip(const UString &str)
8{
9 auto u32str = to_u32string(str);
10 auto u8str = to_ustring(u32str);
11 if (u8str != str)
12 {
13 LogError("String \"%s\" ended up as \"%s\" after utf8->utf32->utf8 roundtrip", str, u8str);
14 return false;
15 }
16 return true;
17}
18
19struct example_unicode
20{

Callers 2

testMethod · 0.85
mainFunction · 0.85

Calls 2

to_u32stringFunction · 0.85
to_ustringFunction · 0.85

Tested by

no test coverage detected