projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ade0eb2
)
test-bitmap: add tests for bitmap_copy()
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Tue, 28 Nov 2017 09:19:04 +0000
(18:19 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Tue, 28 Nov 2017 11:34:36 +0000
(20:34 +0900)
src/test/test-bitmap.c
patch
|
blob
|
history
diff --git
a/src/test/test-bitmap.c
b/src/test/test-bitmap.c
index
6bc88a4
..
fa38056
100644
(file)
--- a/
src/test/test-bitmap.c
+++ b/
src/test/test-bitmap.c
@@
-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);