From 7b6665ba2aa559cc446fea5ad772cd649f4644c5 Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Fri, 11 Sep 2009 11:09:02 -0400 Subject: INI Error handling and interface cleanup Inspired by issue #173 I reviewed the other function of the interface and found a lot of problems with its error handling. Also made INI use collection public interfaces. --- common/ini/ini_config_ut.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'common/ini/ini_config_ut.c') diff --git a/common/ini/ini_config_ut.c b/common/ini/ini_config_ut.c index 3ce08aeaf..6fbade6e2 100644 --- a/common/ini/ini_config_ut.c +++ b/common/ini/ini_config_ut.c @@ -35,6 +35,20 @@ int basic_test(void) struct collection_item *ini_config = NULL; struct collection_item *error_set = NULL; + error = config_for_app("test", NULL, NULL, + &ini_config, INI_STOP_ON_NONE, &error_set); + if (error != EINVAL) { + printf("Expected error EINVAL got somethign else: %d\n",error); + return EINVAL; + } + + error = config_for_app("test", "foo", "bar", + &ini_config, INI_STOP_ON_ANY, &error_set); + if (error != ENOENT) { + printf("Expected error ENOENT got somethign else: %d\n",error); + return ENOENT; + } + error = config_for_app("test", "./ini.conf", "./ini.d", &ini_config, INI_STOP_ON_NONE, &error_set); if (error) { -- cgit