From c006eeb44cc24b3621fe960754df9bc79aac41be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lodewijk=20V=C3=B6ge?= Date: Tue, 15 Jan 2019 15:12:37 -0500 Subject: [PATCH] test for issue 76 --- test/file_descriptor_test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/file_descriptor_test.cpp b/test/file_descriptor_test.cpp index 79757e529..4f57a28bd 100644 --- a/test/file_descriptor_test.cpp +++ b/test/file_descriptor_test.cpp @@ -173,6 +173,24 @@ void file_descriptor_test() file.close(); BOOST_CHECK(!file.is_open()); } + +#ifdef _WIN64 + { + temp_file temp; + file_descriptor_sink file(temp.name(), BOOST_IOS::trunc); + std::streamsize len = static_cast(4ULL * 1024 * 1024 * 1024 + 1); + std::unique_ptr buf(new char[len]); + memset(&buf[0], 0, len); + std::streamsize written = file.write(&buf[0], len); + std::streamsize pos = file.seek(0, BOOST_IOS::cur); + BOOST_CHECK_MESSAGE( + pos == written, + "silent short write" + ); + file.close(); + BOOST_CHECK(!file.is_open()); + } +#endif { temp_file temp;