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

Function TEST

pj_datastore/tests/encoding_test.cpp:55–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53// ==========================================================================
54
55TEST(DictionaryEncoding, RepeatedStrings) {
56 auto col = makeStringColumn({"base", "world", "base", "base"});
57
58 auto encoded = dictionaryEncodeStrings(Span<const uint8_t>(col.offsets), Span<const uint8_t>(col.values), 4);
59
60 EXPECT_EQ(encoded.count, 4u);
61 EXPECT_EQ(encoded.dictionary.size(), 2u);
62 EXPECT_EQ(encoded.dictionary[0], "base");
63 EXPECT_EQ(encoded.dictionary[1], "world");
64
65 EXPECT_EQ(dictionaryLookup(encoded, 0), "base");
66 EXPECT_EQ(dictionaryLookup(encoded, 1), "world");
67 EXPECT_EQ(dictionaryLookup(encoded, 2), "base");
68 EXPECT_EQ(dictionaryLookup(encoded, 3), "base");
69}
70
71TEST(DictionaryEncoding, AllUniqueStrings) {
72 auto col = makeStringColumn({"alpha", "beta", "gamma", "delta"});

Callers

nothing calls this directly

Calls 15

makeStringColumnFunction · 0.85
dictionaryEncodeStringsFunction · 0.85
dictionaryLookupFunction · 0.85
packBoolsFunction · 0.85
unpackBoolFunction · 0.85
constantEncodeFunction · 0.85
constantDecodeAsDoubleFunction · 0.85
forEncodeFunction · 0.85
forDecodeOneAsDoubleFunction · 0.85
forDecodeRangeAsDoublesFunction · 0.85
indexBytesForFunction · 0.85
offsetBytesForFunction · 0.85

Tested by

no test coverage detected