Commit c65777dd3c for openssl.org
commit c65777dd3c67a7d5ae33ff63cdd3534d36417d9d
Author: Mounir IDRASSI <mounir.idrassi@idrix.fr>
Date: Thu Apr 16 11:07:25 2026 +0900
Add stack test for thunked sorted lookup
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Sat Jul 4 16:53:24 2026
(Merged from https://github.com/openssl/openssl/pull/30857)
diff --git a/test/stack_test.c b/test/stack_test.c
index 16d72f809e..c2ed731f44 100644
--- a/test/stack_test.c
+++ b/test/stack_test.c
@@ -255,6 +255,15 @@ static int test_uchar_stack(int reserve)
goto end;
sk_uchar_sort(r);
sk_uchar_sort(q);
+ for (i = 0; i < n; i++) {
+ int idx = sk_uchar_find(q, v + i);
+
+ if (!TEST_int_ge(idx, 0)
+ || !TEST_uchar_eq(*sk_uchar_value(q, idx), v[i])) {
+ TEST_info("uchar sorted find %d", i);
+ goto end;
+ }
+ }
/* pop */
for (i = 0; i < n; i++) {