From ccb429435e162915917f2492217c4e206b9b2a96 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Fri, 23 Dec 2016 17:13:03 +0100 Subject: blogc: common: git-receiver: improved error handling --- tests/blogc-git-receiver/check_post_receive.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/blogc-git-receiver/check_post_receive.c b/tests/blogc-git-receiver/check_post_receive.c index 74a9a29..8e56f98 100644 --- a/tests/blogc-git-receiver/check_post_receive.c +++ b/tests/blogc-git-receiver/check_post_receive.c @@ -31,7 +31,10 @@ __wrap_realpath(const char *path, char *resolved_path) static void test_post_receive_get_config_section(void **state) { - bc_config_t *config = bc_config_parse("", 0, NULL); + bc_error_t *err = NULL; + + bc_config_t *config = bc_config_parse("", 0, &err); + assert_null(err); assert_null(bgr_post_receive_get_config_section(config, "/home/blogc/repos/foo.git", "/home/blogc")); bc_config_free(config); @@ -48,7 +51,8 @@ test_post_receive_get_config_section(void **state) "[repo:baz.git]\n" "mirror = baz\n" "\n"; - config = bc_config_parse(conf, strlen(conf), NULL); + config = bc_config_parse(conf, strlen(conf), &err); + assert_null(err); char *s = bgr_post_receive_get_config_section(config, "/home/blogc/repos/bar.git", "/home/blogc"); assert_string_equal(s, "repo:bar.git"); @@ -67,7 +71,8 @@ test_post_receive_get_config_section(void **state) "[repo:asd/baz.git]\n" "mirror = baz\n" "\n"; - config = bc_config_parse(conf, strlen(conf), NULL); + config = bc_config_parse(conf, strlen(conf), &err); + assert_null(err); s = bgr_post_receive_get_config_section(config, "/home/blogc/repos/asd/bar.git", "/home/blogc"); assert_string_equal(s, "repo:asd/bar.git"); -- cgit v1.2.3-18-g5258