| 39 | } |
| 40 | |
| 41 | TEST(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 | |
| 61 | TEST(TextShaperCache, useFontIdAsKey) { |
| 62 | TextShaperCache cache(8); |
nothing calls this directly
no test coverage detected