Generalize the backing type of bitvec

This commit is contained in:
Nils O. Selåsdal
2013-10-28 23:21:26 +01:00
parent 215035190e
commit eceda7be70
3 changed files with 20 additions and 16 deletions
+7 -7
View File
@@ -3,7 +3,7 @@
START_TEST (test_bitvec_1)
unsigned long s[3] = {0};
uc_bv_integer s[3] = {0};
struct UCBitVec v = UC_BV_STATIC_INIT(s);
size_t i;
@@ -12,7 +12,7 @@ START_TEST (test_bitvec_1)
END_TEST
START_TEST (test_bitvec_2)
unsigned long s[3] = {0};
uc_bv_integer s[3] = {0};
struct UCBitVec v = UC_BV_STATIC_INIT(s);
size_t i;
@@ -24,17 +24,17 @@ START_TEST (test_bitvec_2)
END_TEST
START_TEST (test_bitvec_clearbit)
unsigned long s[3] = {-1, -1, -1};
uc_bv_integer s[3] = {-1, -1, -1};
struct UCBitVec v = UC_BV_STATIC_INIT(s);
size_t i;
for (i = 0; i < sizeof(unsigned long) * 8; i++)
for (i = 0; i < sizeof(uc_bv_integer) * 8; i++)
fail_if(uc_bv_get_bit(&v, i) != 1 , "bit %zu is not 1", i);
for (i = 0; i < sizeof(unsigned long) * 8; i++)
for (i = 0; i < sizeof(uc_bv_integer) * 8; i++)
uc_bv_clr_bit(&v, i);
for (i = 0; i < sizeof(unsigned long) * 8; i++)
for (i = 0; i < sizeof(uc_bv_integer) * 8; i++)
fail_if(uc_bv_get_bit(&v, i) != 0 , "bit %zu is not 0", i);
END_TEST
@@ -63,7 +63,7 @@ START_TEST (test_bitvec_setall_clearall)
uc_bv_clr_all(v);
for (i = 0; i < sizeof(unsigned long) * 8; i++)
for (i = 0; i < sizeof(uc_bv_integer) * 8; i++)
fail_if(uc_bv_get_bit(v, i) != 0 , "bit %zu is not 0", i);
uc_bv_free(v);