Commit 22e1d8971b for openssl.org
commit 22e1d8971b790f417827c1bde81b8453f26219a4
Author: Pauli <paul.dale@oracle.com>
Date: Wed Jan 14 08:14:38 2026 +1100
test: fix tests in lightof test_strn2_ removals
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29627)
diff --git a/test/endecoder_legacy_test.c b/test/endecoder_legacy_test.c
index 04f26174b5..6315a3ca82 100644
--- a/test/endecoder_legacy_test.c
+++ b/test/endecoder_legacy_test.c
@@ -293,8 +293,8 @@ static int test_membio_str_eq(BIO *bio_provided, BIO *bio_legacy)
return TEST_long_ge(len_legacy, 0)
&& TEST_long_ge(len_provided, 0)
- && TEST_strn2_eq(str_provided, len_provided,
- str_legacy, len_legacy);
+ && TEST_size_t_eq(len_provided, len_legacy)
+ && TEST_strn_eq(str_provided, str_legacy, len_provided);
}
static int test_protected_PEM(const char *keytype, int evp_type,
diff --git a/test/trace_api_test.c b/test/trace_api_test.c
index 532c31be2b..5a24de4163 100644
--- a/test/trace_api_test.c
+++ b/test/trace_api_test.c
@@ -147,7 +147,7 @@ static int test_trace_channel(void)
ret = put_trace_output();
len = BIO_get_mem_data(bio, &p_buf);
- if (!TEST_strn2_eq(p_buf, len, expected, expected_len))
+ if (!TEST_size_t_eq(len, expected_len) || !TEST_strn_eq(p_buf, expected, len))
ret = 0;
ret = TEST_int_eq(OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_HTTP, NULL), 1)
&& ret;