summaryrefslogtreecommitdiff
path: root/src/test/test-bitmap.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-07-19 02:53:23 -0400
committerDaniel Mack <github@zonque.org>2015-07-19 02:53:23 -0400
commitafd56ac532efd68d1ab633bb1ed365542f32a803 (patch)
treefd6a99b9ee96ffdd378d46d16770cedb02b96ae0 /src/test/test-bitmap.c
parent511ed7991737dc567bef51a8051a1a577fa18e05 (diff)
parentcdf6f5ae0465a8fb25d2afc758911985cc542a07 (diff)
Merge pull request #614 from teg/bitmap-overflow
basic: bitmap - complete fix for bitshift overflow
Diffstat (limited to 'src/test/test-bitmap.c')
-rw-r--r--src/test/test-bitmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-bitmap.c b/src/test/test-bitmap.c
index 77db784a94..96deeded7e 100644
--- a/src/test/test-bitmap.c
+++ b/src/test/test-bitmap.c
@@ -58,6 +58,14 @@ int main(int argc, const char *argv[]) {
assert_se(bitmap_isset(b, 256) == false);
assert_se(bitmap_isclear(b) == true);
+ assert_se(bitmap_set(b, 32) == 0);
+ bitmap_unset(b, 0);
+ assert_se(bitmap_isset(b, 32) == true);
+ bitmap_unset(b, 32);
+
+ BITMAP_FOREACH(n, NULL, it)
+ assert_not_reached("NULL bitmap");
+
assert_se(bitmap_set(b, 0) == 0);
assert_se(bitmap_set(b, 1) == 0);
assert_se(bitmap_set(b, 256) == 0);