aboutsummaryrefslogtreecommitdiffstats
path: root/tests/common
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-12-25 01:47:50 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-12-25 01:47:50 +0100
commit54d563e10f381ea01cf0ed93f2b97fcac848808c (patch)
treee9d1e7655576413d6cdaa4f519a720273006e5ee /tests/common
parent6636bd99d6767a99546b1b82ce69ade6df867b42 (diff)
downloadblogc-54d563e10f381ea01cf0ed93f2b97fcac848808c.tar.gz
blogc-54d563e10f381ea01cf0ed93f2b97fcac848808c.tar.bz2
blogc-54d563e10f381ea01cf0ed93f2b97fcac848808c.zip
config-parser: bc_config_get_list should return array instead of list
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/check_config_parser.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/common/check_config_parser.c b/tests/common/check_config_parser.c
index b542c88..a04dc6d 100644
--- a/tests/common/check_config_parser.c
+++ b/tests/common/check_config_parser.c
@@ -388,11 +388,12 @@ test_config_section_list(void **state)
assert_string_equal(bc_config_get(c, "foo", "asd"), "zxc");
assert_string_equal(bc_config_get(c, "foo", "qwe"), "rty");
assert_string_equal(bc_config_get(c, "foo", "zxc"), "vbn");
- bc_slist_t *foo = bc_config_get_list(c, "bar");
- assert_non_null(foo);
- assert_string_equal(foo->data, "lol = hehe");
- assert_string_equal(foo->next->data, "asdasdadssad");
- assert_null(foo->next->next);
+ char **bar = bc_config_get_list(c, "bar");
+ assert_non_null(bar);
+ assert_string_equal(bar[0], "lol = hehe");
+ assert_string_equal(bar[1], "asdasdadssad");
+ assert_null(bar[2]);
+ bc_strv_free(bar);
char **k = bc_config_list_keys(c, "foo");
assert_non_null(k);
assert_int_equal(bc_strv_length(k), 3);
@@ -430,11 +431,12 @@ test_config_section_list(void **state)
assert_string_equal(bc_config_get(c, "foo", "asd"), "zxc");
assert_string_equal(bc_config_get(c, "foo", "qwe"), "rty");
assert_string_equal(bc_config_get(c, "foo", "zxc"), "vbn");
- foo = bc_config_get_list(c, "bar");
- assert_non_null(foo);
- assert_string_equal(foo->data, "lol = hehe");
- assert_string_equal(foo->next->data, "asdasdadssad");
- assert_null(foo->next->next);
+ bar = bc_config_get_list(c, "bar");
+ assert_non_null(bar);
+ assert_string_equal(bar[0], "lol = hehe");
+ assert_string_equal(bar[1], "asdasdadssad");
+ assert_null(bar[2]);
+ bc_strv_free(bar);
k = bc_config_list_keys(c, "foo");
assert_non_null(k);
assert_int_equal(bc_strv_length(k), 3);
@@ -472,11 +474,12 @@ test_config_section_list(void **state)
assert_string_equal(bc_config_get(c, "foo", "asd"), "zxc");
assert_string_equal(bc_config_get(c, "foo", "qwe"), "rty");
assert_string_equal(bc_config_get(c, "foo", "zxc"), "vbn");
- foo = bc_config_get_list(c, "bar");
- assert_non_null(foo);
- assert_string_equal(foo->data, "lol = hehe");
- assert_string_equal(foo->next->data, "asdasdadssad");
- assert_null(foo->next->next);
+ bar = bc_config_get_list(c, "bar");
+ assert_non_null(bar);
+ assert_string_equal(bar[0], "lol = hehe");
+ assert_string_equal(bar[1], "asdasdadssad");
+ assert_null(bar[2]);
+ bc_strv_free(bar);
k = bc_config_list_keys(c, "foo");
assert_non_null(k);
assert_int_equal(bc_strv_length(k), 3);