From: Pauli Date: Tue, 13 Jan 2026 21:14:38 +0000 (+1100) Subject: test: fix tests in lightof test_strn2_ removals X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22e1d8971b790f417827c1bde81b8453f26219a4;p=thirdparty%2Fopenssl.git test: fix tests in lightof test_strn2_ removals Reviewed-by: Norbert Pocs Reviewed-by: Nikola Pajkovsky Reviewed-by: Frederik Wedel-Heinen (Merged from https://github.com/openssl/openssl/pull/29627) --- diff --git a/test/endecoder_legacy_test.c b/test/endecoder_legacy_test.c index 04f26174b53..6315a3ca825 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 532c31be2b0..5a24de41635 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;