Add more tests for bitset_resize

This commit is contained in:
Patrick Pelissier committed 2021-02-22 11:40:29 +01:00
1 parent a82f2ba065
commit 5fd6352a4e
1 file changed
+14
+14
View File
@@ -69,6 +69,20 @@ static void test1(void)
for(int i = 50; i < 100; i ++) {
assert (bitset_get(set2, (size_t) i) == false);
}
bitset_resize(set2, 128);
for(int i = 0; i < 50; i ++) {
assert (bitset_get(set2, (size_t) i) == M_ASSIGN_CAST(bool, i%2));
}
for(int i = 50; i < 128; i ++) {
assert (bitset_get(set2, (size_t) i) == false);
}
bitset_resize(set2, 64);
for(int i = 0; i < 50; i ++) {
assert (bitset_get(set2, (size_t) i) == M_ASSIGN_CAST(bool, i%2));
}
for(int i = 50; i < 64; i ++) {
assert (bitset_get(set2, (size_t) i) == false);
}
bitset_resize(set2, 50);
// Push from 0