From: Marc-André Lureau Date: Wed, 7 Jun 2017 16:35:55 +0000 (+0400) Subject: tests: Remove test cases for alternates of 'number' and 'int' X-Git-Tag: v2.10.0-rc0~119^2~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c877c80308a8d0166029494e2e236c1f95336e8;p=thirdparty%2Fqemu.git tests: Remove test cases for alternates of 'number' and 'int' Alternates with both a 'number' and an 'int' branch will become invalid when the next patch merges of QFloat and QInt into QNum. More sophisticated alternate code could keep them valid, but since we have no users outside tests, simply drop the tests. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Message-Id: <20170607163635.17635-4-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster --- diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json index 17649c6398a..91ffb2648cb 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -103,8 +103,6 @@ { 'alternate': 'AltEnumNum', 'data': { 'e': 'EnumOne', 'n': 'number' } } { 'alternate': 'AltNumEnum', 'data': { 'n': 'number', 'e': 'EnumOne' } } { 'alternate': 'AltEnumInt', 'data': { 'e': 'EnumOne', 'i': 'int' } } -{ 'alternate': 'AltIntNum', 'data': { 'i': 'int', 'n': 'number' } } -{ 'alternate': 'AltNumInt', 'data': { 'n': 'number', 'i': 'int' } } # for testing use of 'str' within alternates { 'alternate': 'AltStrObj', 'data': { 's': 'str', 'o': 'TestStruct' } } diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out index 9f68610dc2b..e727a5a84c9 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -10,18 +10,10 @@ alternate AltEnumNum tag type case e: EnumOne case n: number -alternate AltIntNum - tag type - case i: int - case n: number alternate AltNumEnum tag type case n: number case e: EnumOne -alternate AltNumInt - tag type - case n: number - case i: int alternate AltStrObj tag type case s: str diff --git a/tests/test-keyval.c b/tests/test-keyval.c index c3be00524ce..baf7e339abb 100644 --- a/tests/test-keyval.c +++ b/tests/test-keyval.c @@ -615,7 +615,7 @@ static void test_keyval_visit_alternate(void) Visitor *v; QDict *qdict; AltStrObj *aso; - AltNumInt *ani; + AltNumEnum *ane; AltEnumBool *aeb; /* @@ -631,7 +631,7 @@ static void test_keyval_visit_alternate(void) g_assert_cmpint(aso->type, ==, QTYPE_QSTRING); g_assert_cmpstr(aso->u.s, ==, "1"); qapi_free_AltStrObj(aso); - visit_type_AltNumInt(v, "b", &ani, &err); + visit_type_AltNumEnum(v, "b", &ane, &err); error_free_or_abort(&err); visit_type_AltEnumBool(v, "c", &aeb, &err); error_free_or_abort(&err); diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-visitor.c index 6b997a177d7..83d663d11d9 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -592,8 +592,6 @@ static void test_visitor_in_alternate_number(TestInputVisitorData *data, AltEnumNum *aen; AltNumEnum *ans; AltEnumInt *asi; - AltIntNum *ain; - AltNumInt *ani; /* Parsing an int */ @@ -620,18 +618,6 @@ static void test_visitor_in_alternate_number(TestInputVisitorData *data, g_assert_cmpint(asi->u.i, ==, 42); qapi_free_AltEnumInt(asi); - v = visitor_input_test_init(data, "42"); - visit_type_AltIntNum(v, NULL, &ain, &error_abort); - g_assert_cmpint(ain->type, ==, QTYPE_QINT); - g_assert_cmpint(ain->u.i, ==, 42); - qapi_free_AltIntNum(ain); - - v = visitor_input_test_init(data, "42"); - visit_type_AltNumInt(v, NULL, &ani, &error_abort); - g_assert_cmpint(ani->type, ==, QTYPE_QINT); - g_assert_cmpint(ani->u.i, ==, 42); - qapi_free_AltNumInt(ani); - /* Parsing a double */ v = visitor_input_test_init(data, "42.5"); @@ -655,18 +641,6 @@ static void test_visitor_in_alternate_number(TestInputVisitorData *data, visit_type_AltEnumInt(v, NULL, &asi, &err); error_free_or_abort(&err); qapi_free_AltEnumInt(asi); - - v = visitor_input_test_init(data, "42.5"); - visit_type_AltIntNum(v, NULL, &ain, &error_abort); - g_assert_cmpint(ain->type, ==, QTYPE_QFLOAT); - g_assert_cmpfloat(ain->u.n, ==, 42.5); - qapi_free_AltIntNum(ain); - - v = visitor_input_test_init(data, "42.5"); - visit_type_AltNumInt(v, NULL, &ani, &error_abort); - g_assert_cmpint(ani->type, ==, QTYPE_QFLOAT); - g_assert_cmpfloat(ani->u.n, ==, 42.5); - qapi_free_AltNumInt(ani); } static void test_native_list_integer_helper(TestInputVisitorData *data,