tests: Use error_free_or_abort() where appropriate

Replace

    g_assert(err != NULL);
    error_free(err);
    err = NULL;

and variations thereof by

    error_free_or_abort(&err);

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200630090351.1247703-6-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2020-06-30 11:03:30 +02:00
parent d8da9e71b6
commit 7b8eb7f848
7 changed files with 14 additions and 39 deletions

View file

@ -115,9 +115,7 @@ static void test_update_perm_tree(void)
BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, &error_abort);
bdrv_append(filter, bs, &local_err);
g_assert_nonnull(local_err);
error_free(local_err);
error_free_or_abort(&local_err);
blk_unref(root);
}