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_BIDIRECTIONAL_STREAMBUF_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_WRITE_BIDIRECTIONAL_STREAMBUF_HPP_INCLUDED
12 #include <boost/iostreams/filtering_stream.hpp>
13 #include <boost/test/test_tools.hpp>
14 #include "detail/temp_file.hpp"
15 #include "detail/verification.hpp"
17 void write_bidirectional_streambuf_test()
20 using namespace boost;
21 using namespace boost::iostreams;
22 using namespace boost::iostreams::test;
30 dest.open(test2.name().c_str(), out_mode);
31 filtering_stream<bidirectional> out(dest, 0);
32 write_data_in_chars(out);
35 compare_files(test2.name(), test.name()),
36 "failed writing to filtering_stream<bidirectional> based "
37 "on a streambuf in chars with no buffer"
45 dest.open(test2.name().c_str(), out_mode);
46 filtering_stream<bidirectional> out(dest, 0);
47 write_data_in_chunks(out);
50 compare_files(test2.name(), test.name()),
51 "failed writing to filtering_stream<bidirectional> based "
52 "on a streambuf in chunks with no buffer"
60 dest.open(test2.name().c_str(), out_mode);
61 filtering_stream<bidirectional> out(dest);
62 write_data_in_chars(out);
65 compare_files(test2.name(), test.name()),
66 "failed writing to filtering_stream<bidirectional> based "
67 "on a streambuf in chars with large buffer"
75 dest.open(test2.name().c_str(), out_mode);
76 filtering_stream<bidirectional> out(dest);
77 write_data_in_chunks(out);
80 compare_files(test2.name(), test.name()),
81 "failed writing to filtering_stream<bidirectional> based "
82 "on a streambuf in chunks with large buffer"
87 #endif // #ifndef BOOST_IOSTREAMS_TEST_WRITE_BIDIRECTIONAL_STREAMBUF_HPP_INCLUDED