From: Marko Kreen Date: Sun, 15 Jun 2014 10:49:48 +0000 (+0300) Subject: test_cfparser: allow run from top dir X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=27c9029108862422def952e026e71657f8c6f625;p=libusual.git test_cfparser: allow run from top dir --- diff --git a/test/test_cfparser.c b/test/test_cfparser.c index 2409c83..894e70d 100644 --- a/test/test_cfparser.c +++ b/test/test_cfparser.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "test_common.h" @@ -117,10 +118,14 @@ static struct CfContext cfdesc2 = { rsects, &cf1 }; static void test_rel(void *ptr) { char buf[128]; + const char *fn = "test_cfparser.ini"; cleanup(); - int_check(1, cf_load_file(&cfdesc2, "test_cfparser.ini")); + if (file_size(fn) < 0) + fn = "test/test_cfparser.ini"; + + int_check(1, cf_load_file(&cfdesc2, fn)); str_check(cf1.str1, "val1"); tt_assert(cf1.def1 == NULL);