| 28 | static const std::string INDEX_PATH = "brute_force_searcher_test/out.indexes"; |
| 29 | |
| 30 | static void BuildIndex(const IndexMeta &meta, IndexHolder::Pointer holder, |
| 31 | const std::string &path) { |
| 32 | auto builder = IndexFactory::CreateBuilder("FlatBuilder"); |
| 33 | auto dumper = IndexFactory::CreateDumper("FileDumper"); |
| 34 | |
| 35 | ASSERT_NE(nullptr, builder); |
| 36 | ASSERT_NE(nullptr, dumper); |
| 37 | |
| 38 | Params params; |
| 39 | ASSERT_EQ(0, builder->init(meta, params)); |
| 40 | ASSERT_EQ(0, dumper->create(path)); |
| 41 | ASSERT_EQ(0, IndexBuilder::TrainBuildAndDump(builder, holder, dumper)); |
| 42 | ASSERT_EQ(0, dumper->close()); |
| 43 | |
| 44 | auto stats = builder->stats(); |
| 45 | ASSERT_EQ(0UL, stats.trained_count()); |
| 46 | ASSERT_EQ(0UL, stats.discarded_count()); |
| 47 | } |
| 48 | |
| 49 | static void BuildIndex(const IndexMeta &meta, const Params ¶ms, |
| 50 | IndexHolder::Pointer holder, const std::string &path) { |
no test coverage detected