summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2024-01-05 16:10:33 +0800
committerchenzizhan <[email protected]>2024-01-05 16:10:33 +0800
commit0926557c8de3dc969c094bbaf39c1dff2953c990 (patch)
tree930342adbb7a3a9811df902d1ebeaa765fa27e70
parent013cd69b3f45fe1dfd598e6b75a2044c6f8af5f5 (diff)
try ci
-rw-r--r--test/test_easy_fs.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/test/test_easy_fs.cpp b/test/test_easy_fs.cpp
index a37e9dd..3bf658a 100644
--- a/test/test_easy_fs.cpp
+++ b/test/test_easy_fs.cpp
@@ -248,25 +248,27 @@ TEST(test_easy_fieldstat, accuracy_in_multithread)
printf("spawn threads finished\n");
- // char **objects = NULL;
- // size_t n_objects = 0;
- // std::regex pattern(R"("hit number":(\d+))");
-
- // // main thread output(every 1s)
- // long long total_hit_number = 0;
- // for (int i = 0; i < 10; i++) {
- // fieldstat_easy_output_array_and_reset(fse, &objects, &n_objects);
- // if (n_objects == 0) {
- // continue;
- // }
-
- // total_hit_number += get_value(objects[0], "hit number");
+ char **objects = NULL;
+ size_t n_objects = 0;
+ // main thread output(every 1s)
+ long long total_hit_number = 0;
+ for (int i = 0; i < 10; i++) {
+ printf("output %d 1\n", i);
+ fieldstat_easy_output_array_and_reset(fse, &objects, &n_objects);
+ if (n_objects == 0) {
+ continue;
+ }
+ printf("output %d 2\n", i);
+
+ total_hit_number += get_value(objects[0], "hit number");
+ printf("output %d 3\n", i);
+
- // free(objects[0]);
- // free(objects);
+ free(objects[0]);
+ free(objects);
- // sleep(1);
- // }
+ sleep(1);
+ }
sleep(10); // wait for other threads to finish