Lines Matching refs:fail_unless
124 fail_unless(cfg_size(cfg, "string") == 1);
125 fail_unless(cfg_opt_size(cfg_getopt(cfg, "string")) == 1);
126 fail_unless(strcmp(cfg_getstr(cfg, "string"), "default") == 0);
127 fail_unless(cfg_getnstr(cfg, "string", 0) == cfg_getstr(cfg, "string"));
128 fail_unless(cfg_getnstr(cfg, "string", 1) == 0);
130 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
131 fail_unless(strcmp(cfg_getstr(cfg, "string"), "set") == 0);
133 fail_unless(strcmp(cfg_getstr(cfg, "string"), "manually set") == 0);
140 fail_unless(cfg_size(cfg, "integer") == 1);
141 fail_unless(cfg_opt_size(cfg_getopt(cfg, "integer")) == 1);
142 fail_unless(cfg_getint(cfg, "integer") == 4711);
143 fail_unless(cfg_getnint(cfg, "integer", 0) == cfg_getint(cfg, "integer"));
144 fail_unless(cfg_getnint(cfg, "integer", 1) == 0);
146 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
147 fail_unless(cfg_getint(cfg, "integer") == -46);
149 fail_unless(cfg_getint(cfg, "integer") == 999999);
156 fail_unless(cfg_size(cfg, "float") == 1);
157 fail_unless(cfg_opt_size(cfg_getopt(cfg, "float")) == 1);
158 fail_unless(cfg_getfloat(cfg, "float") == 0.42);
159 fail_unless(cfg_getnfloat(cfg, "float", 0) == cfg_getfloat(cfg, "float"));
160 fail_unless(cfg_getnfloat(cfg, "float", 1) == 0);
162 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
163 fail_unless(cfg_getfloat(cfg, "float") == -46.777);
165 fail_unless(cfg_getfloat(cfg, "float") == 5.1234e2);
172 fail_unless(cfg_size(cfg, "bool") == 1);
173 fail_unless(cfg_opt_size(cfg_getopt(cfg, "bool")) == 1);
174 fail_unless(cfg_getbool(cfg, "bool") == cfg_false);
177 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
178 fail_unless(cfg_getbool(cfg, "bool") == cfg_true);
180 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
181 fail_unless(cfg_getbool(cfg, "bool") == cfg_false);
183 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
184 fail_unless(cfg_getbool(cfg, "bool") == cfg_true);
186 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
187 fail_unless(cfg_getbool(cfg, "bool") == cfg_false);
189 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
190 fail_unless(cfg_getbool(cfg, "bool") == cfg_true);
192 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
193 fail_unless(cfg_getbool(cfg, "bool") == cfg_false);
196 fail_unless(cfg_getbool(cfg, "bool") == cfg_true);
198 fail_unless(cfg_getbool(cfg, "bool") == cfg_false);
206 fail_unless(cfg_size(cfg, "section") == 1);
207 fail_unless(cfg_opt_size(cfg_getopt(cfg, "section")) == 1);
209 fail_unless(cfg_size(cfg, "section|subsection") == 1);
210 fail_unless(cfg_opt_size(cfg_getopt(cfg, "section|subsection")) == 1);
212 fail_unless(cfg_size(cfg, "section|subsection|subsubstring") == 1);
213 fail_unless(cfg_opt_size(cfg_getopt(cfg, "section|subsection|subsubinteger")) == 1);
215 fail_unless(cfg_title(cfg_getsec(cfg, "section")) == 0);
216 fail_unless(cfg_title(cfg_getsec(cfg, "section|subsection")) == 0);
218 fail_unless(strcmp(cfg_getstr(cfg, "section|substring"), "subdefault") == 0);
220 fail_unless(sec != 0);
221 fail_unless(cfg_getint(sec, "subsubinteger") == -42);
223 fail_unless(cfg_getnsec(cfg, "section", 0) == cfg_getsec(cfg, "section"));
224 fail_unless(cfg_getnsec(cfg, "section", 1) == 0);
227 fail_unless(sec != 0);
229 fail_unless(subsec != 0);
230 fail_unless(cfg_getfloat(subsec, "subsubfloat") == 19923.1234);
233 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
242 fail_unless(cfg_size(cfg, "ip-address") == 0);
245 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
247 fail_unless(ipaddr != 0);
248 fail_unless(strcmp("192.168.0.1", inet_ntoa(*ipaddr)) == 0);
251 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
254 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
256 fail_unless(etheraddr != 0);
257 fail_unless(my_ether_ntoa(etheraddr) != 0);
259 fail_unless(memcmp(etheraddr, cmpether, 6) == 0);
262 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
269 fail_unless(cfg_parse_buf(cfg, 0) == CFG_SUCCESS);
270 fail_unless(cfg_parse_buf(cfg, "") == CFG_SUCCESS);
273 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
276 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
279 fail_unless(cfg_parse_buf(cfg, buf) == CFG_PARSE_ERROR);
284 fail_unless(cfg_getopt(cfg, "nonexistent") == 0);
285 fail_unless(cfg_getopt(cfg, "section|subnonexistent") == 0);
293 fail_unless(cfg_size(cfg, "nodefstring") == 0);
295 fail_unless(cfg_size(cfg, "nodefstring") == 1);
296 fail_unless(cfg_size(cfg, "nodefsec") == 0);
299 fail_unless(cfg_parse_buf(cfg, buf) == CFG_SUCCESS);
301 fail_unless(nodefsec != 0);
302 fail_unless(cfg_size(nodefsec, "string") == 1);
303 fail_unless(cfg_size(nodefsec, "int") == 0);