X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=t%2Funit%2Fcore%2Fstore_json_test.c;h=6be3c144e37f3cc2466f1ffa840a408c4e12a0ce;hp=ebb2daf1d22ec7cee81e267d97ca476612b5abe9;hb=a873701765e00228463e06795bdde21274e8fa74;hpb=e04534362b8993b5400e0859aae9a38cfcc08aa6 diff --git a/t/unit/core/store_json_test.c b/t/unit/core/store_json_test.c index ebb2daf..6be3c14 100644 --- a/t/unit/core/store_json_test.c +++ b/t/unit/core/store_json_test.c @@ -29,6 +29,7 @@ # include "config.h" #endif +#include "core/plugin.h" #include "core/store.h" #include "testutils.h" @@ -46,41 +47,45 @@ populate(void) sdb_store_init(); - sdb_store_host("h1", 1 * SDB_INTERVAL_SECOND); - sdb_store_host("h2", 3 * SDB_INTERVAL_SECOND); + sdb_plugin_store_host("h1", 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_host("h2", 3 * SDB_INTERVAL_SECOND); datum.type = SDB_TYPE_STRING; datum.data.string = "v1"; - sdb_store_attribute("h1", "k1", &datum, 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_attribute("h1", "k1", &datum, 1 * SDB_INTERVAL_SECOND); datum.data.string = "v2"; - sdb_store_attribute("h1", "k2", &datum, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_attribute("h1", "k2", &datum, 2 * SDB_INTERVAL_SECOND); datum.data.string = "v3"; - sdb_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND); /* make sure that older updates don't overwrite existing values */ datum.data.string = "fail"; - sdb_store_attribute("h1", "k2", &datum, 1 * SDB_INTERVAL_SECOND); - sdb_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_attribute("h1", "k2", &datum, 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND); - sdb_store_metric("h1", "m1", /* store */ NULL, 2 * SDB_INTERVAL_SECOND); - sdb_store_metric("h1", "m2", /* store */ NULL, 1 * SDB_INTERVAL_SECOND); - sdb_store_metric("h2", "m1", /* store */ NULL, 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_metric("h1", "m1", /* store */ NULL, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_metric("h1", "m2", /* store */ NULL, 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_metric("h2", "m1", /* store */ NULL, 1 * SDB_INTERVAL_SECOND); - sdb_store_service("h2", "s1", 1 * SDB_INTERVAL_SECOND); - sdb_store_service("h2", "s2", 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_service("h2", "s1", 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_service("h2", "s2", 2 * SDB_INTERVAL_SECOND); datum.type = SDB_TYPE_INTEGER; datum.data.integer = 42; - sdb_store_metric_attr("h1", "m1", "k3", &datum, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_metric_attribute("h1", "m1", "k3", + &datum, 2 * SDB_INTERVAL_SECOND); datum.data.integer = 123; - sdb_store_service_attr("h2", "s2", "k1", &datum, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_service_attribute("h2", "s2", "k1", + &datum, 2 * SDB_INTERVAL_SECOND); datum.data.integer = 4711; - sdb_store_service_attr("h2", "s2", "k2", &datum, 1 * SDB_INTERVAL_SECOND); + sdb_plugin_store_service_attribute("h2", "s2", "k2", + &datum, 1 * SDB_INTERVAL_SECOND); /* don't overwrite k1 */ datum.data.integer = 666; - sdb_store_service_attr("h2", "s2", "k1", &datum, 2 * SDB_INTERVAL_SECOND); + sdb_plugin_store_service_attribute("h2", "s2", "k1", + &datum, 2 * SDB_INTERVAL_SECOND); } /* populate */ static int @@ -481,8 +486,8 @@ START_TEST(test_store_tojson) verify_json_output(buf, store_tojson_data[_i].expected); - free(f); sdb_object_deref(SDB_OBJ(filter)); + sdb_object_deref(SDB_OBJ(f)); sdb_strbuf_destroy(buf); } END_TEST