]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test: fix tests in lightof test_strn2_ removals
authorPauli <paul.dale@oracle.com>
Tue, 13 Jan 2026 21:14:38 +0000 (08:14 +1100)
committerPauli <paul.dale@oracle.com>
Thu, 15 Jan 2026 21:31:21 +0000 (08:31 +1100)
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)

test/endecoder_legacy_test.c
test/trace_api_test.c

index 04f26174b53293a455684d9a3fd6e921f2d103f8..6315a3ca825db5b421fad80b7e80d7a168a38ab2 100644 (file)
@@ -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,
index 532c31be2b0adc83158e17fef2dc1019e53c48eb..5a24de416359443fb2474d4709c980bd40e1675d 100644 (file)
@@ -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;