summaryrefslogtreecommitdiff
path: root/tests/virbitmaptest.c
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2020-03-18 15:51:14 +0100
committerPeter Krempa <pkrempa@redhat.com>2020-03-20 09:47:16 +0100
commit3ceb6951bdb11f303f3d9f62fcdf363306fcd873 (patch)
treeefdc8128be7cdbc92e32107fa7454451c107670b /tests/virbitmaptest.c
parent299796328c34a30295d6cdc7ebce5d65843e921f (diff)
downloadlibvirt-3ceb6951bdb11f303f3d9f62fcdf363306fcd873.tar.gz
virBitmapNewEmpty: Use g_new0 to allocate and remove error checking
virBitmapNewEmpty can't fail now so we can make it obvious and fix all callers. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'tests/virbitmaptest.c')
-rw-r--r--tests/virbitmaptest.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
index 2808d9c880..1c7dc1d610 100644
--- a/tests/virbitmaptest.c
+++ b/tests/virbitmaptest.c
@@ -193,8 +193,7 @@ test4(const void *data G_GNUC_UNUSED)
/* 0. empty set */
- if (!(bitmap = virBitmapNewEmpty()))
- goto error;
+ bitmap = virBitmapNewEmpty();
if (virBitmapNextSetBit(bitmap, -1) != -1)
goto error;
@@ -632,12 +631,9 @@ test11(const void *opaque)
static int
test12(const void *opaque G_GNUC_UNUSED)
{
- virBitmapPtr map = NULL;
+ virBitmapPtr map = virBitmapNewEmpty();
int ret = -1;
- if (!(map = virBitmapNewEmpty()))
- return -1;
-
TEST_MAP(0, "");
if (virBitmapSetBitExpand(map, 128) < 0)