MCPcopy Create free account
hub / github.com/aseprite/laf / TEST

Function TEST

base/string_tests.cpp:27–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27TEST(String, Utf8Conversion)
28{
29 std::string a = "\xE6\xBC\xA2\xE5\xAD\x97"; // 漢字
30 ASSERT_EQ(6, a.size());
31
32 std::wstring b = from_utf8(a);
33 ASSERT_EQ(2, b.size());
34 ASSERT_EQ(0x6f22, b[0]);
35 ASSERT_EQ(0x5b57, b[1]);
36
37 std::string c = to_utf8(b);
38 ASSERT_EQ(a, c);
39}
40
41TEST(String, Utf8Decode)
42{

Callers

nothing calls this directly

Calls 10

from_utf8Function · 0.85
utf8_decodeClass · 0.85
count_utf8_codepointsFunction · 0.85
utf8_icmpFunction · 0.85
utf8_lengthFunction · 0.85
string_to_lowerFunction · 0.85
is_validMethod · 0.80
to_utf8Function · 0.70
sizeMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected