summaryrefslogtreecommitdiffstats
path: root/exporting/tests/exporting_fixtures.c
diff options
context:
space:
mode:
Diffstat (limited to 'exporting/tests/exporting_fixtures.c')
-rw-r--r--exporting/tests/exporting_fixtures.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/exporting/tests/exporting_fixtures.c b/exporting/tests/exporting_fixtures.c
index 501fc405c9..4f5bd4b277 100644
--- a/exporting/tests/exporting_fixtures.c
+++ b/exporting/tests/exporting_fixtures.c
@@ -41,17 +41,9 @@ int setup_rrdhost()
localhost->tags = strdupz("TAG1=VALUE1 TAG2=VALUE2");
- struct label *label = calloc(1, sizeof(struct label));
- label->key = strdupz("key1");
- label->value = strdupz("value1");
- label->label_source = LABEL_SOURCE_NETDATA_CONF;
- localhost->labels.head = label;
-
- label = calloc(1, sizeof(struct label));
- label->key = strdupz("key2");
- label->value = strdupz("value2");
- label->label_source = LABEL_SOURCE_AUTO;
- localhost->labels.head->next = label;
+ localhost->host_labels = rrdlabels_create();
+ rrdlabels_add(localhost->host_labels, "key1", "value1", RRDLABEL_SRC_CONFIG);
+ rrdlabels_add(localhost->host_labels, "key2", "value2", RRDLABEL_SRC_CONFIG);
localhost->rrdset_root = calloc(1, sizeof(RRDSET));
RRDSET *st = localhost->rrdset_root;
@@ -94,12 +86,7 @@ int teardown_rrdhost()
free((void *)st->name);
free(st);
- free(localhost->labels.head->next->key);
- free(localhost->labels.head->next->value);
- free(localhost->labels.head->next);
- free(localhost->labels.head->key);
- free(localhost->labels.head->value);
- free(localhost->labels.head);
+ rrdlabels_destroy(localhost->host_labels);
free((void *)localhost->tags);
free(localhost);
@@ -124,7 +111,7 @@ int teardown_initialized_engine(void **state)
struct engine *engine = *state;
teardown_rrdhost();
- buffer_free(engine->instance_root->labels);
+ buffer_free(engine->instance_root->labels_buffer);
buffer_free(engine->instance_root->buffer);
teardown_configured_engine(state);