Skip to content

Commit c006eeb

Browse files
author
Lodewijk Vöge
committed
test for issue 76
1 parent 50b4f00 commit c006eeb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/file_descriptor_test.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,24 @@ void file_descriptor_test()
173173
file.close();
174174
BOOST_CHECK(!file.is_open());
175175
}
176+
177+
#ifdef _WIN64
178+
{
179+
temp_file temp;
180+
file_descriptor_sink file(temp.name(), BOOST_IOS::trunc);
181+
std::streamsize len = static_cast<std::streamsize>(4ULL * 1024 * 1024 * 1024 + 1);
182+
std::unique_ptr<char[]> buf(new char[len]);
183+
memset(&buf[0], 0, len);
184+
std::streamsize written = file.write(&buf[0], len);
185+
std::streamsize pos = file.seek(0, BOOST_IOS::cur);
186+
BOOST_CHECK_MESSAGE(
187+
pos == written,
188+
"silent short write"
189+
);
190+
file.close();
191+
BOOST_CHECK(!file.is_open());
192+
}
193+
#endif
176194

177195
{
178196
temp_file temp;

0 commit comments

Comments
 (0)