diff options
| author | chenzizhan <[email protected]> | 2023-07-31 16:03:15 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-07-31 16:03:15 +0800 |
| commit | f3269add7a259a0f622656172a8e4e00f4bfc9cc (patch) | |
| tree | 77d5777c0276dbbe603a4400150f827499e26347 /test/test_fuzz_test.cpp | |
| parent | 3f4c11cbc6bb31b0d3b3ad13c4cfdeeba27b1171 (diff) | |
sort tag bug fix and some more tests after lcov
Diffstat (limited to 'test/test_fuzz_test.cpp')
| -rw-r--r-- | test/test_fuzz_test.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/test_fuzz_test.cpp b/test/test_fuzz_test.cpp index 852b203..57562d3 100644 --- a/test/test_fuzz_test.cpp +++ b/test/test_fuzz_test.cpp @@ -29,7 +29,7 @@ TEST(Fuzz_test, both_comp_and_topk_cubes_with_merge_and_reset_expecting_correct_ const char *metric_name_of_topk[METRIC_NUM] = {"topk1", "topk2"}; const char *metric_name_of_comprehensive[METRIC_NUM] = {"counter_", "hll_"}; const int CELL_NUM = 50; - const int CUBE_NUM = 1; + const int CUBE_NUM = 10; int cube_ids[CUBE_NUM]; bool cube_is_topk[CUBE_NUM]; unordered_map<string, int> topk_count_per_metric[CUBE_NUM][METRIC_NUM]; @@ -43,7 +43,7 @@ TEST(Fuzz_test, both_comp_and_topk_cubes_with_merge_and_reset_expecting_correct_ Fieldstat_tag_list_wrapper *tag_list_wrapper[CELL_NUM]; fill_random_tag_of_length_1_to_3(tag_list_wrapper, CELL_NUM); - const int TEST_ROUND = 10001; + const int TEST_ROUND = 100001; struct fieldstat *instance = fieldstat_new(); struct fieldstat *instance_dest = fieldstat_new(); long long rand_nums[TEST_ROUND]; @@ -77,7 +77,7 @@ TEST(Fuzz_test, both_comp_and_topk_cubes_with_merge_and_reset_expecting_correct_ clock_t start = clock(); for (int i = 0; i < TEST_ROUND; i++) { - if (i != 0 && i % 100 == 0) { + if (i != 0 && i % 1000 == 0) { char *blob; size_t blob_len; fieldstat_serialize(instance, &blob, &blob_len); @@ -119,7 +119,6 @@ TEST(Fuzz_test, both_comp_and_topk_cubes_with_merge_and_reset_expecting_correct_ string cell_key = tmp->to_string(); comp_count[cube_id][cell_key] += rand_nums[i]; comp_hll[cube_id][cell_key].insert(*val); - cout << "add: " << cell_key << "of count" << rand_nums[i] << endl; } } @@ -178,8 +177,6 @@ TEST(Fuzz_test, both_comp_and_topk_cubes_with_merge_and_reset_expecting_correct_ string cell_key = Fieldstat_tag_list_wrapper(&tags0[j]).to_string(); EXPECT_EQ(comp_count[cubes[i]][cell_key], fieldstat_counter_get(instance_in_focus, cubes[i], 0, cells0[j])); EXPECT_NEAR(comp_hll[cubes[i]][cell_key].size(), fieldstat_hll_get(instance_in_focus, cubes[i], 1, cells0[j]), comp_hll[cubes[i]][cell_key].size() * 0.2); - - cout << "get: " << cell_key << " of count: "<< fieldstat_counter_get(instance_in_focus, cubes[i], 0, cells0[j]) << endl; } } |
