MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / TEST

Function TEST

src/base/string_tests.cpp:18–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16bool all(int) { return true; }
17
18TEST(String, Utf8Conversion)
19{
20 std::string a = "\xE6\xBC\xA2\xE5\xAD\x97"; // 漢字
21 ASSERT_EQ(6, a.size());
22
23 std::wstring b = from_utf8(a);
24 ASSERT_EQ(2, b.size());
25 ASSERT_EQ(0x6f22, b[0]);
26 ASSERT_EQ(0x5b57, b[1]);
27
28 std::string c = to_utf8(b);
29 ASSERT_EQ(a, c);
30}
31
32TEST(String, Utf8Iterator)
33{

Callers

nothing calls this directly

Calls 9

from_utf8Function · 0.85
to_utf8Function · 0.85
utf8_iteratorClass · 0.85
utf8_icmpFunction · 0.85
utf8_lengthFunction · 0.85
string_to_lowerFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected