public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] stdlib: Verify heapsort for two-element cases Date: Tue, 16 Jan 2024 15:20:41 +0000 (GMT) [thread overview] Message-ID: <20240116152041.911113858C53@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1bb28b7b4f01709b841c86850e1bb83b554feafe commit 1bb28b7b4f01709b841c86850e1bb83b554feafe Author: Kuan-Wei Chiu <visitorckw@gmail.com> Date: Tue Jan 16 10:16:57 2024 +0800 stdlib: Verify heapsort for two-element cases Adjust the testing approach to start from scenarios with only 2 elements, as insertion sort no longer handles such cases. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Diff: --- stdlib/tst-qsort4.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stdlib/tst-qsort4.c b/stdlib/tst-qsort4.c index 4635275419..247917b454 100644 --- a/stdlib/tst-qsort4.c +++ b/stdlib/tst-qsort4.c @@ -96,9 +96,7 @@ do_test (void) check_one_sort ((signed char[16]) {15, 3, 4, 2, 1, 0, 8, 7, 6, 5, 14, 13, 12, 11, 10, 9}, 16); - /* Array lengths 2 and less are not handled by heapsort_r and - deferred to insertion sort. */ - for (int i = 3; i <= 8; ++i) + for (int i = 2; i <= 8; ++i) { signed char *buf = xmalloc (i); check_combinations (i, buf, 0);
reply other threads:[~2024-01-16 15:20 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240116152041.911113858C53@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).