X-Git-Url: http://git.efficios.com/?p=argpar.git;a=blobdiff_plain;f=tests%2Ftest_argpar.c;fp=tests%2Ftest_argpar.c;h=4674d8984fc706cecab75cc5b3d032e25f4531ed;hp=fa915d87a81a8082e670179fcc11f54c51db8c7a;hb=7ac57709d4964e2c59c9b0592632c374056caa00;hpb=903a5b8ab5ab38d3b200b1d692ba0d29d080c92c diff --git a/tests/test_argpar.c b/tests/test_argpar.c index fa915d8..4674d89 100644 --- a/tests/test_argpar.c +++ b/tests/test_argpar.c @@ -15,13 +15,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include #include #include #include "tap/tap.h" -#include "common/assert.h" - #include "argpar/argpar.h" /* @@ -48,8 +47,8 @@ void test_succeed(const char *cmdline, gchar **argv = g_strsplit(cmdline, " ", 0); unsigned int i; - BT_ASSERT(argv); - BT_ASSERT(res_str); + assert(argv); + assert(res_str); parse_ret = bt_argpar_parse(g_strv_length(argv), (const char * const *) argv, descrs, false); ok(parse_ret.items, @@ -70,8 +69,8 @@ void test_succeed(const char *cmdline, goto end; } - for (i = 0; i < parse_ret.items->len; i++) { - const struct bt_argpar_item *arg = parse_ret.items->pdata[i]; + for (i = 0; i < parse_ret.items->n_items; i++) { + const struct bt_argpar_item *arg = parse_ret.items->items[i]; switch (arg->type) { case BT_ARGPAR_ITEM_TYPE_OPT: @@ -518,12 +517,12 @@ void test_fail(const char *cmdline, const char *expected_error, goto end; } - ok(strcmp(expected_error, parse_ret.error->str) == 0, + ok(strcmp(expected_error, parse_ret.error) == 0, "bt_argpar_parse() writes the expected error string " "for command line `%s`", cmdline); - if (strcmp(expected_error, parse_ret.error->str) != 0) { + if (strcmp(expected_error, parse_ret.error) != 0) { diag("Expected: `%s`", expected_error); - diag("Got: `%s`", parse_ret.error->str); + diag("Got: `%s`", parse_ret.error); } end: