From: Stephen Seo Date: Sun, 30 Jun 2024 11:02:47 +0000 (+0900) Subject: Fix unit test for priority heap X-Git-Tag: 1.0~92 X-Git-Url: https://git.seodisparate.com/stephenseo/static/static/git-logo.png?a=commitdiff_plain;h=467c09a0e4b53a08d506906de25ff02e3732d3bc;p=SimpleArchiver Fix unit test for priority heap --- diff --git a/src/data_structures/test.c b/src/data_structures/test.c index 99c0602..e5299a6 100644 --- a/src/data_structures/test.c +++ b/src/data_structures/test.c @@ -224,7 +224,7 @@ int main(void) { for (unsigned int idx = max - 1; idx-- > 0;) { unsigned int other_idx = simple_archiver_algo_lcg_defaults(idx) % (unsigned long long)(idx + 1); - if (idx != other_idx) { + if (max - 1 != other_idx) { unsigned int temp = array[max - 1]; array[max - 1] = array[other_idx]; array[other_idx] = temp; @@ -292,7 +292,7 @@ int main(void) { for (unsigned int idx = max - 1; idx-- > 0;) { unsigned int other_idx = simple_archiver_algo_lcg_defaults(idx) % (unsigned long long)(idx + 1); - if (idx != other_idx) { + if (max - 1 != other_idx) { unsigned int temp = array[max - 1]; array[max - 1] = array[other_idx]; array[other_idx] = temp;