diff options
| author | chenzizhan <[email protected]> | 2023-07-26 10:34:50 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-07-26 10:34:50 +0800 |
| commit | c8fe516e20a376b0b48669d3224e67bd71a23a6a (patch) | |
| tree | f5cb0e99124e554a5bc34d4b10bfac198c7c9e98 /test/unit_test_cell_manager.cpp | |
| parent | 9e90b8c20d6410a96b6f8afa452dc9bfd4edbce4 (diff) | |
delete heavy_keeper_result_new, delete tag->is_hashed; cell_manager_merge_topk implement id tag map
Diffstat (limited to 'test/unit_test_cell_manager.cpp')
| -rw-r--r-- | test/unit_test_cell_manager.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/unit_test_cell_manager.cpp b/test/unit_test_cell_manager.cpp index 7f1fada..f44fda6 100644 --- a/test/unit_test_cell_manager.cpp +++ b/test/unit_test_cell_manager.cpp @@ -78,6 +78,7 @@ vector<tag_hash_key *> test_query_cell_manager_content(struct cell_manager *cm) continue; } test_result.push_back((struct tag_hash_key *)dump_ret[i]); + printf("query content, id: %d, key: %s\n", i, tag_hash_key_get_compound_key(dump_ret[i])); } return test_result; @@ -164,8 +165,8 @@ TEST(unit_test_cell_manager, merge_topk_given_K_large_enough) EXPECT_EQ(cell_id_old[1], cell_id_2[1]); // key_2 in cm2 auto test_result = test_query_cell_manager_content(cm1); - // double accuracy = cal_accuracy(keys, test_result); - // EXPECT_NEAR(accuracy, 1.0, 0.01); + double accuracy = cal_accuracy(keys, test_result); + EXPECT_NEAR(accuracy, 1.0, 0.01); EXPECT_EQ(cell_manager_get_count_by_tag(cm1, keys[0]), 2); // key_share merged once @@ -280,9 +281,8 @@ TEST(unit_test_cell_manager, merge_topk_to_full_one) auto test_result = test_query_cell_manager_content(cm2); // join keys2 to keys1 keys1.insert(keys1.end(), std::make_move_iterator(keys2.begin()), std::make_move_iterator(keys2.end())); - - // double accuracy = cal_accuracy(keys1, test_result); - // EXPECT_NEAR(accuracy, 1.0, 0.01); + double accuracy = cal_accuracy(keys1, test_result); + EXPECT_NEAR(accuracy, 1.0, 0.01); free(cell_id_popped); free(cell_id_old); @@ -295,7 +295,6 @@ TEST(unit_test_cell_manager, merge_topk_to_full_one) // all keys are moved to cm1, so no need to free keys2 } -//todo: cell_manager_copy int main(int argc, char *argv[]) { |
