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
+6
View File
@@ -52,6 +52,7 @@ static int cmp_stuff_array(const struct Stuff *a, const struct Stuff *b, size_t
}
START_TEST (test_heapsort_odd)
{
struct Stuff unordered[] = {
{"2", 2},
{"1", 1},
@@ -72,9 +73,11 @@ START_TEST (test_heapsort_odd)
cmp_stuff, swap_stuff, NULL);
print_stuff(unordered, ARRAY_SIZE(unordered));
fail_if(cmp_stuff_array(unordered, ordered, ARRAY_SIZE(unordered)) != 0);
}
END_TEST
START_TEST (test_heapsort_even)
{
struct Stuff unordered[] = {
{"1", 1},
{"7", 7},
@@ -96,9 +99,11 @@ START_TEST (test_heapsort_even)
uc_heapsort(unordered, ARRAY_SIZE(unordered), sizeof(struct Stuff),
cmp_stuff, swap_stuff, NULL);
fail_if(cmp_stuff_array(unordered, ordered, ARRAY_SIZE(unordered)) != 0);
}
END_TEST
START_TEST (test_heapsort_zero_one)
{
struct Stuff unordered[] = {
{"1", 1},
{"7", 7},
@@ -128,6 +133,7 @@ START_TEST (test_heapsort_zero_one)
uc_heapsort(unordered, 1, sizeof(struct Stuff),
cmp_stuff, swap_stuff, NULL);
fail_if(cmp_stuff_array(unordered, same, ARRAY_SIZE(unordered)) != 0);
}
END_TEST
Suite *heapsort_suite(void)