summaryrefslogtreecommitdiff
path: root/test/src/gtest_fieldstat_output_file_instance.cpp
diff options
context:
space:
mode:
authorfumingwei <[email protected]>2023-06-06 10:31:54 +0800
committerfumingwei <[email protected]>2023-06-06 10:32:01 +0800
commit1518429de72e89af6c943b740eaa5df5df155853 (patch)
tree7e731b47d49aaa9aa26b5fc53e74a0e721d71114 /test/src/gtest_fieldstat_output_file_instance.cpp
parentcf3354b9682748c86977635a22cd136f0529d03b (diff)
bugfix:修复文件输出table column0信息显示不全的问题v3.0.6
Diffstat (limited to 'test/src/gtest_fieldstat_output_file_instance.cpp')
-rw-r--r--test/src/gtest_fieldstat_output_file_instance.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/test/src/gtest_fieldstat_output_file_instance.cpp b/test/src/gtest_fieldstat_output_file_instance.cpp
index 5f3a962..2556223 100644
--- a/test/src/gtest_fieldstat_output_file_instance.cpp
+++ b/test/src/gtest_fieldstat_output_file_instance.cpp
@@ -19,17 +19,24 @@ TEST(FeildStatOutput, OutputMaatTable)
char line[2048] = {0};
const char *output_file_path = "/tmp/fieldstat.txt";
- const char *table_column_name[] = {"rule", "reg", "v6", "stream", "scan_cnt", "scan_bytes", "scan_cpu_time", "hit_cnt"};
- const char *compared_table_row = "PXY_PROFILE_RUN_SCRIPT"
- " 9223372036854775807 0 0 0"
- " 0 0 0 0\n";
-
- enum field_type table_column_type[8] = {FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE};
+ const char *table_column_name[] = {
+ "rule", "reg", "v6", "stream", "scan_cnt", "scan_bytes", "scan_cpu_time", "hit_cnt"
+ };
+ const char *compared_table_row = "PXY_PROFILE_RUN_SCRIPTS 9223372036854775807"
+ " 0 0 0"
+ " 0 0 0"
+ " 0\n";
+
+ enum field_type table_column_type[8] = {
+ FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE,
+ FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE, FIELD_TYPE_GAUGE
+ };
instance = fieldstat_instance_new("maat");
EXPECT_STREQ("maat", instance->name);
- table_id = fieldstat_register_table(instance, "maat_info", table_column_name, table_column_type, sizeof(table_column_name)/sizeof(table_column_name[0]));
+ table_id = fieldstat_register_table(instance, "maat_info", table_column_name, table_column_type,
+ sizeof(table_column_name)/sizeof(table_column_name[0]));
EXPECT_EQ(0, table_id);
ret = fieldstat_register_table_row(instance, table_id, "Sum", NULL, 0, output_metric_ids);
EXPECT_EQ(0, ret);