]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Make minmax_heap_burn_in() exercise all operations (CID #1503996) (#4478)
authorJames Jones <jejones3141@gmail.com>
Fri, 29 Apr 2022 19:16:56 +0000 (14:16 -0500)
committerGitHub <noreply@github.com>
Fri, 29 Apr 2022 19:16:56 +0000 (15:16 -0400)
random choice of operation wasn't hitting all cases

src/lib/util/minmax_heap_tests.c

index 9229a7bef4d815a70c00752fc85cd6adfcd42229..a0898a62585274591571dc24a31d42233fd39159 100644 (file)
@@ -250,7 +250,7 @@ static void minmax_heap_burn_in(void)
                        TEST_CHECK((ret_insert = fr_minmax_heap_insert(hp, &array[insert_count])) >= 0);
                        insert_count++;
                } else {
-                       switch (rand() % 3) {
+                       switch (rand() % 5) {
                        case 0: /* insert */
                                goto insert;