MCPcopy Create free account
hub / github.com/catboost/catboost / TestClear

Method TestClear

library/cpp/containers/comptrie/comptrie_ut.cpp:985–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

983}
984
985void TCompactTrieTest::TestClear() {
986 TCompactTrieBuilder<char, ui32> builder;
987 const char* data[] = {
988 "Kazan",
989 "Moscow",
990 "Monino",
991 "Murmansk",
992 "Fryanovo",
993 "Fryazino",
994 "Fryazevo",
995 "Fry",
996 "Tumen",
997 };
998 for (size_t i = 0; i < Y_ARRAY_SIZE(data); ++i) {
999 builder.Add(data[i], strlen(data[i]), i + 1);
1000 }
1001 UNIT_ASSERT(builder.GetEntryCount() == Y_ARRAY_SIZE(data));
1002 builder.Clear();
1003 UNIT_ASSERT(builder.GetEntryCount() == 0);
1004 UNIT_ASSERT(builder.GetNodeCount() == 1);
1005}
1006
1007void TCompactTrieTest::TestFindTails() {
1008 TestFindTailsImpl("aa");

Callers

nothing calls this directly

Calls 4

GetEntryCountMethod · 0.80
GetNodeCountMethod · 0.80
AddMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected