From 2a4640f6719b9688a68b796f697209b9b14cd179 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Fri, 4 Apr 2008 10:11:22 +0000 Subject: make parse_ini die like in N::P if section isn't found git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1976 f882894a-f735-0410-b71e-b25c423dba1c --- lib/tests/test_ini.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/tests/test_ini.c') diff --git a/lib/tests/test_ini.c b/lib/tests/test_ini.c index 80396caa..1ab1e5d3 100644 --- a/lib/tests/test_ini.c +++ b/lib/tests/test_ini.c @@ -55,7 +55,7 @@ main (int argc, char **argv) { char *optstr=NULL; - plan_tests(12); + plan_tests(11); optstr=list2str(np_get_defaults("section@./config-tiny.ini", "check_disk")); ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "config-tiny.ini's section as expected"); @@ -65,9 +65,13 @@ main (int argc, char **argv) ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "Used default section name, without specific"); my_free(optstr); - optstr=list2str(np_get_defaults("section_unknown@./config-tiny.ini", "section")); - ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "Used default section name over specified one"); - my_free(optstr); + /* + * This check is expected to die - It's commented so we can eventually put + * it in a separate file for testing the return value + */ + /* optstr=list2str(np_get_defaults("section_unknown@./config-tiny.ini", "section")); + ok( 0, "die if section isn't found"); + my_free(optstr); */ optstr=list2str(np_get_defaults("Section Two@./config-tiny.ini", "check_disk")); ok( !strcmp(optstr, "--something else=blah --remove=whitespace"), "config-tiny.ini's Section Two as expected"); -- cgit v1.2.3-74-g34f1