From 06c60b6c468ca7cde004fe7c3ce35de312855f55 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 24 Aug 2017 10:45:57 +0200 Subject: qapi: Drop superfluous qapi_enum_parse() parameter max MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lookup tables have a sentinel, no need to make callers pass their size. Signed-off-by: Markus Armbruster Message-Id: <1503564371-26090-3-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Eric Blake [Rebased, commit message corrected] --- tests/test-qapi-util.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'tests/test-qapi-util.c') diff --git a/tests/test-qapi-util.c b/tests/test-qapi-util.c index e869757..d72ee8c 100644 --- a/tests/test-qapi-util.c +++ b/tests/test-qapi-util.c @@ -20,25 +20,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); + QTYPE__MAX - 1, &error_abort); g_assert_cmpint(ret, ==, QTYPE__MAX - 1); } -- cgit v1.1