[21/21] tests-blockjob: Use error_free_or_abort()
diff mbox series

Message ID 20191130194240.10517-22-armbru@redhat.com
State New
Headers show
Series
  • Error handling fixes, may contain 4.2 material
Related show

Commit Message

Markus Armbruster Nov. 30, 2019, 7:42 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/test-blockjob.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Eric Blake Dec. 3, 2019, 9:43 p.m. UTC | #1
On 11/30/19 1:42 PM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   tests/test-blockjob.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
> index e670a20617..4eeb184caf 100644
> --- a/tests/test-blockjob.c
> +++ b/tests/test-blockjob.c
> @@ -48,9 +48,8 @@ static BlockJob *mk_job(BlockBackend *blk, const char *id,
>               g_assert_cmpstr(job->job.id, ==, blk_name(blk));
>           }
>       } else {
> -        g_assert_nonnull(err);
> +        error_free_or_abort(&err);
>           g_assert_null(job);
> -        error_free(err);
>       }
>   
>       return job;
>

Patch
diff mbox series

diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index e670a20617..4eeb184caf 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -48,9 +48,8 @@  static BlockJob *mk_job(BlockBackend *blk, const char *id,
             g_assert_cmpstr(job->job.id, ==, blk_name(blk));
         }
     } else {
-        g_assert_nonnull(err);
+        error_free_or_abort(&err);
         g_assert_null(job);
-        error_free(err);
     }
 
     return job;