1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

test-bitmap: add tests for bitmap_copy()

This commit is contained in:
Yu Watanabe 2017-11-28 18:19:04 +09:00
parent ade0eb2190
commit 6b86b9e65d

View File

@ -97,8 +97,19 @@ int main(int argc, const char *argv[]) {
assert_se(i == (unsigned) -1);
b2 = bitmap_copy(b);
assert_se(b2);
assert_se(bitmap_equal(b, b2) == true);
assert_se(bitmap_equal(b, b) == true);
assert_se(bitmap_equal(b, NULL) == false);
assert_se(bitmap_equal(NULL, b) == false);
assert_se(bitmap_equal(NULL, NULL) == true);
bitmap_clear(b);
assert_se(bitmap_isclear(b) == true);
assert_se(bitmap_equal(b, b2) == false);
bitmap_free(b2);
b2 = NULL;
assert_se(bitmap_set(b, (unsigned) -1) == -ERANGE);