1 /* $Id: innconf-t.c 7748 2008-04-06 13:49:56Z iulius $ */
2 /* innconf test suite. */
7 #include "inn/innconf.h"
8 #include "inn/messages.h"
11 static const char grep[] =
12 "egrep 'mta|organization|ovmethod|hismethod|path|pgpverify'\
13 ../../samples/inn.conf > config/tmp";
18 struct innconf *standard;
21 if (access("config/valid", F_OK) < 0)
22 if (access("lib/config/valid", F_OK) == 0)
27 ok(1, innconf_read("../../samples/inn.conf"));
30 if (system(grep) != 0)
31 die("Unable to create stripped configuration file");
32 ok(2, innconf_read("config/tmp"));
34 ok(3, innconf_compare(standard, innconf));
35 innconf_free(standard);
36 innconf_free(innconf);
40 /* Checking inn.conf. */
42 if (system(grep) != 0)
43 die("Unable to create stripped configuration file");
44 ok(5, innconf_check("config/tmp"));
45 ok(6, errors == NULL);
46 innconf_free(innconf);
48 config = fopen("config/tmp", "a");
50 sysdie("Unable to open stripped configuration file for append");
51 fputs("foo: bar\n", config);
53 ok(7, !innconf_check("config/tmp"));
55 ok_string(8, "config/tmp:26: unknown parameter foo\n", errors);
59 innconf_free(innconf);