aboutsummaryrefslogtreecommitdiff
path: root/tests/test-qapi-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-qapi-util.c')
-rw-r--r--tests/test-qapi-util.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c
index e869757..4b5e4f8 100644
--- a/tests/test-qapi-util.c
+++ b/tests/test-qapi-util.c
@@ -12,7 +12,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "qapi/util.h"
#include "test-qapi-types.h"
static void test_qapi_enum_parse(void)
@@ -20,25 +19,20 @@ static void test_qapi_enum_parse(void)
Error *err = NULL;
int ret;
- ret = qapi_enum_parse(QType_lookup, NULL, QTYPE__MAX, QTYPE_NONE,
- &error_abort);
+ ret = qapi_enum_parse(&QType_lookup, NULL, QTYPE_NONE, &error_abort);
g_assert_cmpint(ret, ==, QTYPE_NONE);
- ret = qapi_enum_parse(QType_lookup, "junk", QTYPE__MAX, -1,
- NULL);
+ ret = qapi_enum_parse(&QType_lookup, "junk", -1, NULL);
g_assert_cmpint(ret, ==, -1);
- ret = qapi_enum_parse(QType_lookup, "junk", QTYPE__MAX, -1,
- &err);
+ ret = qapi_enum_parse(&QType_lookup, "junk", -1, &err);
error_free_or_abort(&err);
- ret = qapi_enum_parse(QType_lookup, "none", QTYPE__MAX, -1,
- &error_abort);
+ ret = qapi_enum_parse(&QType_lookup, "none", -1, &error_abort);
g_assert_cmpint(ret, ==, QTYPE_NONE);
- ret = qapi_enum_parse(QType_lookup, QType_lookup[QTYPE__MAX - 1],
- QTYPE__MAX, QTYPE__MAX - 1,
- &error_abort);
+ ret = qapi_enum_parse(&QType_lookup, QType_str(QTYPE__MAX - 1),
+ QTYPE__MAX - 1, &error_abort);
g_assert_cmpint(ret, ==, QTYPE__MAX - 1);
}