| 178 | //--------------Writing to a pre-existing file---------------------------// |
| 179 | { |
| 180 | // Test for Bug #3953 - writing to a pre-existing mapped file. |
| 181 | boost::iostreams::test::test_file first, test; |
| 182 | |
| 183 | mapped_file_params p(first.name()); |
| 184 | p.new_file_size = boost::iostreams::test::data_reps * boost::iostreams::test::data_length(); |
| 185 | boost::iostreams::stream<mapped_file_sink> out; |
| 186 | out.open(mapped_file_sink(p)); |
| 187 | boost::iostreams::test::write_data_in_chars(out); |
| 188 | out.close(); |
| 189 | BOOST_CHECK_MESSAGE( |
| 190 | boost::iostreams::test::compare_files(first.name(), test.name()), |
| 191 | "failed writing to pre-existing mapped file in chars" |
| 192 | ); |
| 193 | } |
| 194 | |