| 243 | } |
| 244 | |
| 245 | bool 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 | |
| 270 | void run_benchmarks(TestUtils::TestRunner& runner, uint32_t num_docs) { |
| 271 | IndexFixture f("bench", DIM); |
no test coverage detected