aboutsummaryrefslogtreecommitdiff
path: root/tests/test-string-output-visitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-12-04 10:36:11 +0100
committerMarkus Armbruster <armbru@redhat.com>2019-12-18 08:36:15 +0100
commit53cb2fc859bef4116bb5e8ef9a80ca6c05963d6f (patch)
treea73ad09ba05c162f5983805b0b8bbe9de28d3ac0 /tests/test-string-output-visitor.c
parente4eb089c62fa7b1e758a895aec7682b4bed6a360 (diff)
downloadqemu-53cb2fc859bef4116bb5e8ef9a80ca6c05963d6f.zip
qemu-53cb2fc859bef4116bb5e8ef9a80ca6c05963d6f.tar.gz
qemu-53cb2fc859bef4116bb5e8ef9a80ca6c05963d6f.tar.bz2
tests: Clean up initialization of Error *err variables
Declaring a local Error *err without initializer looks suspicious. Fuse the declaration with the initialization to avoid that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20191204093625.14836-5-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'tests/test-string-output-visitor.c')
-rw-r--r--tests/test-string-output-visitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c
index 02766c0..1be1540 100644
--- a/tests/test-string-output-visitor.c
+++ b/tests/test-string-output-visitor.c
@@ -207,10 +207,10 @@ static void test_visitor_out_enum_errors(TestOutputVisitorData *data,
const void *unused)
{
EnumOne i, bad_values[] = { ENUM_ONE__MAX, -1 };
- Error *err;
for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) {
- err = NULL;
+ Error *err = NULL;
+
visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err);
error_free_or_abort(&err);
}