diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-04-24 10:43:31 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-04-30 07:26:09 +0200 |
commit | 777d20cfa5735de298f378e9b90f0cd1caafdc2d (patch) | |
tree | cafdd57715a626e270530f85b7bde152d571edc6 /tests/test-string-output-visitor.c | |
parent | 8b7ce95b46815f274aed52857260cb180f6fade3 (diff) |
qapi: Assert output visitors see only valid enum values
output_type_enum() fails when *obj is not a valid value of the enum
type. Should not happen. Drop the check, along with its unit tests.
This unmasks qapi_enum_lookup()'s assertion.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200424084338.26803-9-armbru@redhat.com>
[Commit message tweaked]
Diffstat (limited to 'tests/test-string-output-visitor.c')
-rw-r--r-- | tests/test-string-output-visitor.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c index 1be1540767..3bd732222c 100644 --- a/tests/test-string-output-visitor.c +++ b/tests/test-string-output-visitor.c @@ -203,19 +203,6 @@ static void test_visitor_out_enum(TestOutputVisitorData *data, } } -static void test_visitor_out_enum_errors(TestOutputVisitorData *data, - const void *unused) -{ - EnumOne i, bad_values[] = { ENUM_ONE__MAX, -1 }; - - for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) { - Error *err = NULL; - - visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err); - error_free_or_abort(&err); - } -} - static void output_visitor_test_add(const char *testpath, TestOutputVisitorData *data, @@ -260,12 +247,6 @@ int main(int argc, char **argv) &out_visitor_data, test_visitor_out_enum, false); output_visitor_test_add("/string-visitor/output/enum-human", &out_visitor_data, test_visitor_out_enum, true); - output_visitor_test_add("/string-visitor/output/enum-errors", - &out_visitor_data, test_visitor_out_enum_errors, - false); - output_visitor_test_add("/string-visitor/output/enum-errors-human", - &out_visitor_data, test_visitor_out_enum_errors, - true); output_visitor_test_add("/string-visitor/output/intList", &out_visitor_data, test_visitor_out_intList, false); output_visitor_test_add("/string-visitor/output/intList-human", |