1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
2 // (C) Copyright 2004-2007 Jonathan Turkanis
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
6 // See http://www.boost.org/libs/iostreams for documentation.
8 #ifndef BOOST_IOSTREAMS_TEST_WRITE_SEEKABLE_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_WRITE_SEEKABLE_HPP_INCLUDED
12 #include <boost/iostreams/device/file.hpp>
13 #include <boost/iostreams/filtering_stream.hpp>
14 #include <boost/test/test_tools.hpp>
15 #include "detail/temp_file.hpp"
16 #include "detail/verification.hpp"
18 void write_seekable_test()
21 using namespace boost;
22 using namespace boost::iostreams;
23 using namespace boost::iostreams::test;
26 BOOST_IOS::openmode mode = out_mode | BOOST_IOS::trunc;
30 filtering_stream<seekable> out(file(test2.name(), mode), 0);
31 write_data_in_chars(out);
34 compare_files(test2.name(), test.name()),
35 "failed writing to filtering_stream<seekable> in chars with"
42 filtering_stream<seekable> out(file(test2.name(), mode), 0);
43 write_data_in_chunks(out);
46 compare_files(test2.name(), test.name()),
47 "failed writing to filtering_stream<seekable> in chunks with"
54 filtering_stream<seekable> out(file(test2.name(), mode));
55 write_data_in_chars(out);
58 compare_files(test2.name(), test.name()),
59 "failed writing to filtering_stream<seekable> in chars with"
66 filtering_stream<seekable> out(file(test2.name(), mode));
67 write_data_in_chunks(out);
70 compare_files(test2.name(), test.name()),
71 "failed writing to filtering_stream<seekable> in chunks with"
77 #endif // #ifndef BOOST_IOSTREAMS_TEST_WRITE_SEEKABLE_HPP_INCLUDED