MCPcopy Create free account
hub / github.com/cactus-compute/cactus / test_errors

Function test_errors

tests/test_index.cpp:217–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217bool test_errors() {
218 IndexFixture f("test_errors");
219 if (!f.init()) return false;
220
221 f.add(1, "first");
222 if (f.add(1, "second") == 0) return false;
223
224 if (f.get(999).first == 0) return false;
225
226 if (f.del(999) == 0) return false;
227
228 f.del(1);
229 if (f.del(1) == 0) return false;
230
231 std::vector<float> zero_emb(DIM, 0.0f);
232 if (f.add(2, "zero", zero_emb) == 0) return false;
233
234 return true;
235}
236
237bool test_unicode() {
238 IndexFixture f("test_unicode");

Callers 1

mainFunction · 0.85

Calls 4

delMethod · 0.80
initMethod · 0.45
addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected