tests: simplify code
PATCH 1/1 tests: simplify code
Use error_abort instead of open-coded assert.
Cleaner and shorter.
Reported-by Eric Blake <[email protected]>
Signed-off-by Michael S. Tsirkin <[email protected]>
--- tests/test-string-input-visitor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
tests/test-string-input-visitor.c +1 -3
@@ -69,14 +69,12 @@ static void test_visitor_in_intList(TestInputVisitorData *data, {int64_t value[] = {0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,20 };int16List *res =NULL , *tmp; -Error *errp =NULL ;Visitor *v;int i =0 ; v =visitor_input_test_init (data,"1,2,0,2-4,20,5-9,1-8" ); -visit_type_int16List (v, &res,NULL , &errp); -g_assert (errp ==NULL ); +visit_type_int16List (v, &res,NULL , &error_abort); tmp = res;while (i <sizeof (value) /sizeof (value[0 ])) {g_assert (tmp);
Signature · 1 line
MST
Quoted 9 lines · Michael S. Tsirkin
Use
error_abortinstead of open-coded assert.
Cleaner and shorter.Reported-by Eric Blake <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- tests/test-string-input-visitor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by Eric Blake <[email protected]>
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org