]> git.ipfire.org Git - thirdparty/json-c.git/commit
bug: Fixing runtime issue with test_util_file.c in Windows
authorTyler Erickson <tyler.erickson@seagate.com>
Mon, 20 Oct 2025 18:10:57 +0000 (12:10 -0600)
committerTyler Erickson <tyler.erickson@seagate.com>
Mon, 20 Oct 2025 18:10:57 +0000 (12:10 -0600)
commit3723b182db6f0cf62c5a041ac31f23485433ccac
tree606d242b444600951d516f02bf465f7a188c7f08
parente3a33ae8ae87f724f0675379db5c0a74b09de584
bug: Fixing runtime issue with test_util_file.c in Windows

Windows was failing tests due to how the Windows API works with some of the calls used.
When opening and reading a file O_BINARY is needed otherwise it fails for size checks. This is due to how Windows handles newlines and counts between text and binary mode file reads.

Also fixed is the test for /dev/null.
In Windows, this fails, but crashes due to a missing return statement when it cannot open this file.
I also tried telling windows to open the special file NUL, however that leads to a CRT crash later in the test that cannot be stopped and will always fail. Rather than fail a test that Windows will always fail, it has been disabled in that specific case.

Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
tests/test_util_file.c