diff options
Diffstat (limited to 'src/test/test-format-table.c')
-rw-r--r-- | src/test/test-format-table.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/test/test-format-table.c b/src/test/test-format-table.c index 3dbfda7f96..85cd31ecee 100644 --- a/src/test/test-format-table.c +++ b/src/test/test-format-table.c @@ -4,6 +4,7 @@ #include "alloc-util.h" #include "format-table.h" +#include "json-util.h" #include "string-util.h" #include "strv.h" #include "tests.h" @@ -360,7 +361,7 @@ TEST(strv_wrapped) { } TEST(json) { - _cleanup_(json_variant_unrefp) JsonVariant *v = NULL, *w = NULL; + _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL, *w = NULL; _cleanup_(table_unrefp) Table *t = NULL; assert_se(t = table_new("foo bar", "quux", "piep miau")); @@ -378,18 +379,18 @@ TEST(json) { assert_se(table_to_json(t, &v) >= 0); - assert_se(json_build(&w, - JSON_BUILD_ARRAY( - JSON_BUILD_OBJECT( - JSON_BUILD_PAIR("foo_bar", JSON_BUILD_CONST_STRING("v1")), - JSON_BUILD_PAIR("quux", JSON_BUILD_UNSIGNED(4711)), - JSON_BUILD_PAIR("zzz", JSON_BUILD_BOOLEAN(true))), - JSON_BUILD_OBJECT( - JSON_BUILD_PAIR("foo_bar", JSON_BUILD_STRV(STRV_MAKE("a", "b", "c"))), - JSON_BUILD_PAIR("quux", JSON_BUILD_NULL), - JSON_BUILD_PAIR("zzz", JSON_BUILD_UNSIGNED(0755))))) >= 0); - - assert_se(json_variant_equal(v, w)); + assert_se(sd_json_build(&w, + SD_JSON_BUILD_ARRAY( + SD_JSON_BUILD_OBJECT( + SD_JSON_BUILD_PAIR("foo_bar", JSON_BUILD_CONST_STRING("v1")), + SD_JSON_BUILD_PAIR("quux", SD_JSON_BUILD_UNSIGNED(4711)), + SD_JSON_BUILD_PAIR("zzz", SD_JSON_BUILD_BOOLEAN(true))), + SD_JSON_BUILD_OBJECT( + SD_JSON_BUILD_PAIR("foo_bar", SD_JSON_BUILD_STRV(STRV_MAKE("a", "b", "c"))), + SD_JSON_BUILD_PAIR("quux", SD_JSON_BUILD_NULL), + SD_JSON_BUILD_PAIR("zzz", SD_JSON_BUILD_UNSIGNED(0755))))) >= 0); + + assert_se(sd_json_variant_equal(v, w)); } TEST(table) { @@ -554,15 +555,15 @@ TEST(vertical) { " uuu o: 1K\n" "lllllllllllo: jjjjjjjjjjjjjjjjj\n")); - _cleanup_(json_variant_unrefp) JsonVariant *a = NULL, *b = NULL; + _cleanup_(sd_json_variant_unrefp) sd_json_variant *a = NULL, *b = NULL; assert_se(table_to_json(t, &a) >= 0); - assert_se(json_build(&b, JSON_BUILD_OBJECT( - JSON_BUILD_PAIR("pfft_aa", JSON_BUILD_STRING("foo")), - JSON_BUILD_PAIR("dimpfelmoser", JSON_BUILD_UNSIGNED(1024)), - JSON_BUILD_PAIR("lllllllllllo", JSON_BUILD_STRING("jjjjjjjjjjjjjjjjj")))) >= 0); + assert_se(sd_json_build(&b, SD_JSON_BUILD_OBJECT( + SD_JSON_BUILD_PAIR("pfft_aa", SD_JSON_BUILD_STRING("foo")), + SD_JSON_BUILD_PAIR("dimpfelmoser", SD_JSON_BUILD_UNSIGNED(1024)), + SD_JSON_BUILD_PAIR("lllllllllllo", SD_JSON_BUILD_STRING("jjjjjjjjjjjjjjjjj")))) >= 0); - assert_se(json_variant_equal(a, b)); + assert_se(sd_json_variant_equal(a, b)); } TEST(path_basename) { |