Update tests for new check library & osx

This commit is contained in:
Nils O. Selåsdal
2025-06-28 00:56:58 +02:00
parent 9d2ed015f3
commit fb8979d695
29 changed files with 449 additions and 27 deletions
+10
View File
@@ -3,15 +3,18 @@
START_TEST (test_bitvec_1)
{
uc_bv_integer s[3] = {0};
struct UCBitVec v = UC_BV_STATIC_INIT(s);
size_t i;
for (i = 0; i < sizeof s * 8; i++)
fail_if(uc_bv_get_bit(&v, i), "bit %zu is not 0", i);
}
END_TEST
START_TEST (test_bitvec_2)
{
uc_bv_integer s[3] = {0};
struct UCBitVec v = UC_BV_STATIC_INIT(s);
size_t i;
@@ -21,9 +24,11 @@ START_TEST (test_bitvec_2)
for (i = 0; i < sizeof s * 8; i++)
fail_if(uc_bv_get_bit(&v, i) != 1 , "bit %zu is not 1", i);
}
END_TEST
START_TEST (test_bitvec_clearbit)
{
uc_bv_integer s[3] = {-1, -1, -1};
struct UCBitVec v = UC_BV_STATIC_INIT(s);
size_t i;
@@ -37,9 +42,11 @@ START_TEST (test_bitvec_clearbit)
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
START_TEST (test_bitvec_set_bits_from_array)
{
struct UCBitVec *v = uc_bv_new(5);
char a[] = {1, 0,1 ,0, 1};
@@ -51,10 +58,12 @@ START_TEST (test_bitvec_set_bits_from_array)
fail_if(uc_bv_get_bit(v, 4) != 1 , "bit 4 is wrong");
uc_bv_free(v);
}
END_TEST
START_TEST (test_bitvec_setall_clearall)
{
struct UCBitVec *v = uc_bv_new(511);
size_t i;
@@ -70,6 +79,7 @@ START_TEST (test_bitvec_setall_clearall)
uc_bv_free(v);
}
END_TEST
Suite *bitvec_suite(void)