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

Function test_constructor

tests/test_index.cpp:245–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245bool test_constructor() {
246 {
247 IndexFixture f("test_ctor_valid");
248 if (!f.init()) return false;
249 }
250
251 {
252 IndexFixture f("test_ctor_dim");
253 if (!f.init()) return false;
254 f.add(1, "test");
255 f.keep_files();
256 }
257 {
258 IndexFixture f("test_ctor_dim", 256, false);
259 bool failed = (f.init() == nullptr);
260 std::string dir = f.path();
261 unlink((dir + "/index.bin").c_str());
262 unlink((dir + "/data.bin").c_str());
263 rmdir(dir.c_str());
264 if (!failed) return false;
265 }
266
267 return true;
268}
269
270void run_benchmarks(TestUtils::TestRunner& runner, uint32_t num_docs) {
271 IndexFixture f("bench", DIM);

Callers 1

mainFunction · 0.85

Calls 3

keep_filesMethod · 0.80
initMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected