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

Method TestTrieWithContainers

library/cpp/containers/comptrie/comptrie_ut.cpp:1151–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149
1150template <class TContainer>
1151void TCompactTrieTest::TestTrieWithContainers(const TVector<TUtf16String>& keys, const TVector<TContainer>& sampleData, TString methodName) {
1152 TString fileName = GetSystemTempDir() + "/TCompactTrieTest-TestTrieWithContainers-" + methodName;
1153
1154 TCompactTrieBuilder<wchar16, TContainer> b;
1155 for (size_t i = 0; i < keys.size(); i++) {
1156 b.Add(keys[i], sampleData[i]);
1157 }
1158 TUnbufferedFileOutput out(fileName);
1159 b.Save(out);
1160
1161 TCompactTrie<wchar16, TContainer> trie(TBlob::FromFileSingleThreaded(fileName));
1162 for (size_t i = 0; i < keys.size(); i++) {
1163 TContainer value = trie.Get(keys[i]);
1164 UNIT_ASSERT_VALUES_EQUAL(value.size(), sampleData[i].size());
1165 typename TContainer::const_iterator p = value.begin();
1166 typename TContainer::const_iterator p1 = sampleData[i].begin();
1167 for (; p != value.end(); p++, p1++)
1168 CheckEquality<typename TContainer::value_type>(*p, *p1);
1169 }
1170
1171 unlink(fileName.data());
1172}
1173
1174template <>
1175void TCompactTrieTest::TestTrieWithContainers<std::pair<TUtf16String, TVector<i64>>>(const TVector<TUtf16String>& keys, const TVector<std::pair<TUtf16String, TVector<i64>>>& sampleData, TString methodName) {

Callers

nothing calls this directly

Calls 8

GetSystemTempDirFunction · 0.85
sizeMethod · 0.45
AddMethod · 0.45
SaveMethod · 0.45
GetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected