diff options
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); |
