MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

snap_drawing/test/src/TextShaperCache_tests.cpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41TEST(TextShaperCache, canInsertAndGet) {
42 TextShaperCache cache(8);
43
44 auto characters = utf8ToUnicode("Hello World what is going on!");
45
46 auto result = cache.find(makeCacheKey(1, characters));
47
48 ASSERT_FALSE(result);
49
50 auto shapedGlyphs = generateGlyphVec(characters.data(), characters.size());
51
52 cache.insert(makeCacheKey(1, characters), shapedGlyphs.data(), shapedGlyphs.size());
53
54 result = cache.find(makeCacheKey(1, characters));
55
56 ASSERT_TRUE(result);
57
58 ASSERT_EQ(shapedGlyphs, toGlyphVec(result.value().glyphs, result.value().length));
59}
60
61TEST(TextShaperCache, useFontIdAsKey) {
62 TextShaperCache cache(8);

Callers

nothing calls this directly

Calls 11

utf8ToUnicodeFunction · 0.85
makeCacheKeyFunction · 0.85
generateGlyphVecFunction · 0.85
toGlyphVecFunction · 0.85
insertMethod · 0.65
valueMethod · 0.65
clearMethod · 0.65
containsMethod · 0.65
findMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected