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

Method TestIterateEmptyKey

library/cpp/containers/comptrie/comptrie_ut.cpp:1046–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1044};
1045
1046void TCompactTrieTest::TestIterateEmptyKey() {
1047 TBuffer trieBuffer;
1048 {
1049 TCompactTrieBuilder<char, ui32> builder;
1050 UNIT_ASSERT(builder.Add("", 1));
1051 TBufferStream trieBufferO(trieBuffer);
1052 builder.Save(trieBufferO);
1053 }
1054 TCompactTrie<char, ui32> trie(TBlob::FromBuffer(trieBuffer));
1055 ui32 val;
1056 UNIT_ASSERT(trie.Find("", &val));
1057 UNIT_ASSERT(val == 1);
1058 TCompactTrie<char, ui32>::TConstIterator it = trie.Begin();
1059 UNIT_ASSERT(it.GetKey().empty());
1060 UNIT_ASSERT(it.GetValue() == 1);
1061}
1062
1063void TCompactTrieTest::TestTrieSet() {
1064 TBuffer buffer;

Callers

nothing calls this directly

Calls 7

AddMethod · 0.45
SaveMethod · 0.45
FindMethod · 0.45
BeginMethod · 0.45
emptyMethod · 0.45
GetKeyMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected