diff options
| author | chenzizhan <[email protected]> | 2023-07-26 15:20:29 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-07-26 15:20:29 +0800 |
| commit | e79f08c591dde8efc109fd50ba3a27396dc87339 (patch) | |
| tree | 06af1d2b7e5480e07cb2112dcb750af6c9749680 /test/utils.cpp | |
| parent | c8fe516e20a376b0b48669d3224e67bd71a23a6a (diff) | |
topk accuracy test; fix bugs; all tests pass
Diffstat (limited to 'test/utils.cpp')
| -rw-r--r-- | test/utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/utils.cpp b/test/utils.cpp index 0367ba7..6c72ac1 100644 --- a/test/utils.cpp +++ b/test/utils.cpp @@ -64,6 +64,16 @@ Fieldstat_tag_list_wrapper::Fieldstat_tag_list_wrapper(const char * key, int val tag_list_c.tag[0].value_longlong = value; } +Fieldstat_tag_list_wrapper::Fieldstat_tag_list_wrapper(const char * key, const char *value) +{ + tag_list_c.tag = (struct fieldstat_tag *)malloc(sizeof(struct fieldstat_tag)); + tag_list_c.n_tag = 1; + tag_list_c.tag[0].key = strdup(key); + tag_list_c.tag[0].type = TAG_CSTRING; + tag_list_c.tag[0].value_str = strdup(value); +} + + Fieldstat_tag_list_wrapper::~Fieldstat_tag_list_wrapper() { for (size_t i = 0; i < tag_list_c.n_tag; i++) { free((char *)tag_list_c.tag[i].key); |
