diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index 009fa0dad363374dafd525472a5b0d0bfe067a18..a17ef82fb81a4fd6b7e40f1e10849de772c4974c 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -191,6 +191,23 @@ test4(const void *data ATTRIBUTE_UNUSED) if (ARRAY_CARDINALITY(bitsPos) + ARRAY_CARDINALITY(bitsPosInv) != size) goto error; + /* 0. empty set */ + + if (!(bitmap = virBitmapNewEmpty())) + goto error; + + if (virBitmapNextSetBit(bitmap, -1) != -1) + goto error; + + if (virBitmapLastSetBit(bitmap) != -1) + goto error; + + if (virBitmapNextClearBit(bitmap, -1) != -1) + goto error; + + virBitmapFree(bitmap); + bitmap = NULL; + /* 1. zero set */ bitmap = virBitmapNew(size);