aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-01-31 17:14:52 +0000
committerglozow <gloriajzhao@gmail.com>2024-02-28 22:21:25 +0000
commit4ac0eb543d028379bb2b86ab08bbbb2f9f48d5b1 (patch)
tree70ef29f7b9dc51808e38234479820e6eea975c7e /src/test
parenta718bfafe7ad38bab8a5782ae0db719480984238 (diff)
test: Drop `x` modifier in `fsbridge::fopen` call for mingw builds
The MinGW-w64 toolchain links executables to the old msvcrt C Runtime Library that does not support the `x` modifier for the _wfopen() function. Github-Pull: #29357 Rebased-From: d2fe90571e98e02617682561ea82acb1e2647827
Diffstat (limited to 'src/test')
-rw-r--r--src/test/streams_tests.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp
index f03f7c1da2..9cca92501b 100644
--- a/src/test/streams_tests.cpp
+++ b/src/test/streams_tests.cpp
@@ -29,7 +29,14 @@ BOOST_AUTO_TEST_CASE(xor_file)
BOOST_CHECK_EXCEPTION(xor_file.ignore(1), std::ios_base::failure, HasReason{"AutoFile::ignore: file handle is nullpt"});
}
{
- AutoFile xor_file{raw_file("wbx"), xor_pat};
+#ifdef __MINGW64__
+ // Our usage of mingw-w64 and the msvcrt runtime does not support
+ // the x modifier for the _wfopen().
+ const char* mode = "wb";
+#else
+ const char* mode = "wbx";
+#endif
+ AutoFile xor_file{raw_file(mode), xor_pat};
xor_file << test1 << test2;
}
{