The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=dc34894d4101cdd0b3948540dd331dbe133bff7c

commit dc34894d4101cdd0b3948540dd331dbe133bff7c
Author:     Kyle Evans <[email protected]>
AuthorDate: 2026-12-02 18:52:10 +0000
Commit:     Kyle Evans <[email protected]>
CommitDate: 2026-12-02 18:52:10 +0000

    libc: memstream tests: convert asset_stream() to actual assertions
    
    Just printing doesn't do anything useful here, use assertions to fail
    the tests.
    
    Reviewed by:    ngie, rmoeller, siva
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D62321
---
 lib/libc/tests/stdio/open_memstream2_test.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/libc/tests/stdio/open_memstream2_test.c 
b/lib/libc/tests/stdio/open_memstream2_test.c
index 13df97f12dcd..821ae4141a66 100644
--- a/lib/libc/tests/stdio/open_memstream2_test.c
+++ b/lib/libc/tests/stdio/open_memstream2_test.c
@@ -42,10 +42,9 @@ static size_t len;
 static void
 assert_stream(const char *contents)
 {
-       if (strlen(contents) != len)
-               printf("bad length %zd for \"%s\"\n", len, contents);
-       else if (strncmp(buf, contents, strlen(contents)) != 0)
-               printf("bad buffer \"%s\" for \"%s\"\n", buf, contents);
+       ATF_REQUIRE_EQ(len, strlen(contents));
+       ATF_REQUIRE_MSG(strncmp(buf, contents, len) == 0,
+           "bad buffer \"%s\" for \"%s\"\n", buf, contents);
 }
 
 ATF_TC_WITHOUT_HEAD(open_group_test);

Reply via email to