Lines Matching refs:fail_unless
40 fail_unless(numopts == 5);
56 fail_unless(cfg_size(cfg, "string") == 3);
57 fail_unless(cfg_opt_size(cfg_getopt(cfg, "string")) == 3);
58 fail_unless(strcmp(cfg_getnstr(cfg, "string", 0), "default1") == 0);
59 fail_unless(strcmp(cfg_getnstr(cfg, "string", 1), "default2") == 0);
60 fail_unless(strcmp(cfg_getnstr(cfg, "string", 2), "default3") == 0);
62 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
63 fail_unless(cfg_size(cfg, "string") == 2);
64 fail_unless(strcmp(cfg_getstr(cfg, "string"), "manually") == 0);
65 fail_unless(strcmp(cfg_getnstr(cfg, "string", 1), "set") == 0);
67 fail_unless(strcmp(cfg_getstr(cfg, "string"), "manually set") == 0);
69 fail_unless(strcmp(cfg_getnstr(cfg, "string", 1), "foobar") == 0);
72 fail_unless(cfg_size(cfg, "string") == 5);
73 fail_unless(strcmp(cfg_getnstr(cfg, "string", 3), "bar") == 0);
76 fail_unless(cfg_size(cfg, "string") == 3);
77 fail_unless(strcmp(cfg_getnstr(cfg, "string", 0), "baz") == 0);
80 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
81 fail_unless(cfg_size(cfg, "string") == 5);
82 fail_unless(strcmp(cfg_getnstr(cfg, "string", 3), "gaz") == 0);
83 fail_unless(strcmp(cfg_getnstr(cfg, "string", 4), "onk") == 0);
90 fail_unless(cfg_size(cfg, "integer") == 2);
91 fail_unless(cfg_opt_size(cfg_getopt(cfg, "integer")) == 2);
93 fail_unless(cfg_getint(cfg, "integer") == 4711);
94 fail_unless(cfg_getnint(cfg, "integer", 1) == 123456789);
96 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
97 fail_unless(cfg_size(cfg, "integer") == 1);
98 fail_unless(cfg_getnint(cfg, "integer", 0) == -46);
100 fail_unless(cfg_size(cfg, "integer") == 2);
101 fail_unless(cfg_getnint(cfg, "integer", 1) == 999999);
104 fail_unless(cfg_size(cfg, "integer") == 5);
105 fail_unless(cfg_getnint(cfg, "integer", 3) == 22);
108 fail_unless(cfg_size(cfg, "integer") == 3);
109 fail_unless(cfg_getnint(cfg, "integer", 0) == 11);
112 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
113 fail_unless(cfg_size(cfg, "integer") == 5);
114 fail_unless(cfg_getnint(cfg, "integer", 3) == -1234567890);
115 fail_unless(cfg_getnint(cfg, "integer", 4) == 1234567890);
122 fail_unless(cfg_size(cfg, "float") == 1);
123 fail_unless(cfg_opt_size(cfg_getopt(cfg, "float")) == 1);
125 fail_unless(cfg_getfloat(cfg, "float") == 0.42);
126 fail_unless(cfg_getnfloat(cfg, "float", 0) == 0.42);
129 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
130 fail_unless(cfg_opt_size(cfg_getopt(cfg, "float")) == 5);
131 fail_unless(cfg_getnfloat(cfg, "float", 0) == -46.777);
132 fail_unless(cfg_getnfloat(cfg, "float", 1) == 0.1);
133 fail_unless(cfg_getnfloat(cfg, "float", 2) == 0.2);
134 fail_unless(cfg_getnfloat(cfg, "float", 3) == 0.17);
135 fail_unless(cfg_getnfloat(cfg, "float", 4) == 17.123);
138 fail_unless(cfg_getnfloat(cfg, "float", 1) == 5.1234e2);
141 fail_unless(cfg_size(cfg, "float") == 6);
142 fail_unless(cfg_getnfloat(cfg, "float", 5) == 11.2233);
145 fail_unless(cfg_size(cfg, "float") == 2);
146 fail_unless(cfg_getnfloat(cfg, "float", 0) == 0.3);
147 fail_unless(cfg_getnfloat(cfg, "float", 1) == -18.17e-7);
150 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
151 fail_unless(cfg_size(cfg, "float") == 4);
152 fail_unless(cfg_getnfloat(cfg, "float", 2) == 64.64);
153 fail_unless(cfg_getnfloat(cfg, "float", 3) == 1234.567890);
160 fail_unless(cfg_size(cfg, "bool") == 6);
161 fail_unless(cfg_opt_size(cfg_getopt(cfg, "bool")) == 6);
162 fail_unless(cfg_getnbool(cfg, "bool", 0) == cfg_false);
163 fail_unless(cfg_getnbool(cfg, "bool", 1) == cfg_true);
164 fail_unless(cfg_getnbool(cfg, "bool", 2) == cfg_false);
165 fail_unless(cfg_getnbool(cfg, "bool", 3) == cfg_true);
166 fail_unless(cfg_getnbool(cfg, "bool", 4) == cfg_false);
167 fail_unless(cfg_getnbool(cfg, "bool", 5) == cfg_true);
170 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
171 fail_unless(cfg_size(cfg, "bool") == 5);
172 fail_unless(cfg_getbool(cfg, "bool") == cfg_true);
173 fail_unless(cfg_getnbool(cfg, "bool", 1) == cfg_true);
174 fail_unless(cfg_getnbool(cfg, "bool", 2) == cfg_false);
175 fail_unless(cfg_getnbool(cfg, "bool", 3) == cfg_false);
176 fail_unless(cfg_getnbool(cfg, "bool", 4) == cfg_true);
179 fail_unless(cfg_getbool(cfg, "bool") == cfg_false);
181 fail_unless(cfg_getnbool(cfg, "bool", 1) == cfg_false);
184 fail_unless(cfg_opt_size(cfg_getopt(cfg, "bool")) == 7);
185 fail_unless(cfg_getnbool(cfg, "bool", 5) == cfg_true);
188 fail_unless(cfg_size(cfg, "bool") == 4);
189 fail_unless(cfg_getnbool(cfg, "bool", 0) == cfg_true);
190 fail_unless(cfg_getnbool(cfg, "bool", 1) == cfg_true);
191 fail_unless(cfg_getnbool(cfg, "bool", 2) == cfg_false);
192 fail_unless(cfg_getnbool(cfg, "bool", 3) == cfg_true);
195 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
196 fail_unless(cfg_size(cfg, "bool") == 6);
197 fail_unless(cfg_getnbool(cfg, "bool", 4) == cfg_false);
198 fail_unless(cfg_getnbool(cfg, "bool", 5) == cfg_false);
210 fail_unless(cfg_size(cfg, "section") == 0);
211 fail_unless(cfg_opt_size(cfg_getopt(cfg, "section")) == 0);
212 fail_unless(cfg_size(cfg, "section|subsection") == 0);
213 fail_unless(cfg_opt_size(cfg_getopt(cfg, "section|subsection")) == 0);
216 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
217 fail_unless(cfg_size(cfg, "section") == 1);
220 fail_unless(sec != 0);
221 fail_unless(strcmp(sec->name, "section") == 0);
222 fail_unless(cfg_title(sec) == 0);
225 fail_unless(opt != 0);
226 fail_unless(cfg_opt_size(opt) == 0);
227 fail_unless(cfg_size(sec, "subsection") == 0);
229 fail_unless(strcmp(cfg_getnstr(sec, "substring", 0), "subdefault1") == 0);
231 fail_unless(subsec == 0);
234 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
235 fail_unless(cfg_size(cfg, "section") == 2);
238 fail_unless(sec != 0);
239 fail_unless(strcmp(cfg_title(cfg_getnsec(sec, "subsection", 0)), "foo") == 0);
240 fail_unless(cfg_size(sec, "subinteger") == 14);
243 fail_unless(cfg_size(subsec, "subsubfloat") == 3);
244 fail_unless(cfg_getnfloat(subsec, "subsubfloat", 2) == 5.6);
245 fail_unless(cfg_getnstr(subsec, "subsubstring", 0) == 0);
248 fail_unless(sec != 0);
249 fail_unless(cfg_size(sec, "subsection") == 0);
251 fail_unless(cfg_parse_buf(sec, buf) == CFG_SUCCESS);
252 fail_unless(cfg_size(sec, "subsection") == 1);
254 fail_unless(subsec != 0);
255 fail_unless(strcmp(cfg_title(subsec), "bar") == 0);
256 fail_unless(cfg_getnfloat(subsec, "subsubfloat", 2) == 0);
259 fail_unless(cfg_parse_buf(sec, buf) == CFG_SUCCESS);
260 fail_unless(cfg_gettsec(sec, "subsection", "bar") == subsec);
262 fail_unless(opt != 0);
263 fail_unless(cfg_gettsec(sec, "subsection", "baz") == cfg_opt_gettsec(opt, "baz"));
264 fail_unless(cfg_opt_gettsec(opt, "bar") == subsec);
265 fail_unless(cfg_opt_gettsec(opt, "foo") == 0);
266 fail_unless(cfg_gettsec(sec, "subsection", "section") == 0);
268 fail_unless(cfg_gettsec(cfg, "section", "baz") == 0);
275 fail_unless(cfg_parse_buf(cfg, 0) == CFG_SUCCESS);
276 fail_unless(cfg_parse_buf(cfg, "") == CFG_SUCCESS);
279 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
281 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
284 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
287 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
290 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
293 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
296 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
297 fail_unless(strcmp(cfg_getnstr(cfg, "string", 0), "/usr/local/") == 0);
304 fail_unless(cfg_numopts(cfg->opts) == numopts);
305 fail_unless(cfg_getopt(cfg, "nonexistent") == 0);
308 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
309 fail_unless(cfg_getopt(cfg, "section|subnonexistent") == 0);