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_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_WRITE_BIDIRECTIONAL_HPP_INCLUDED
12 #include <boost/iostreams/combine.hpp>
13 #include <boost/iostreams/device/file.hpp>
14 #include <boost/iostreams/filtering_stream.hpp>
15 #include <boost/test/test_tools.hpp>
16 #include "detail/temp_file.hpp"
17 #include "detail/verification.hpp"
19 void write_bidirectional_test()
22 using namespace boost;
23 using namespace boost::iostreams;
24 using namespace boost::iostreams::test;
30 temp_file src; // Dummy;
31 filtering_stream<bidirectional> out(
32 combine(file_source(src.name()), file_sink(dest.name(), out_mode)), 0
34 write_data_in_chars(out);
37 compare_files(dest.name(), test.name()),
38 "failed writing to filtering_stream<bidirectional> in chars "
45 temp_file src; // Dummy;
46 filtering_stream<bidirectional> out(
47 combine(file_source(src.name()), file_sink(dest.name(), out_mode)), 0
49 write_data_in_chunks(out);
52 compare_files(dest.name(), test.name()),
53 "failed writing to filtering_stream<bidirectional> in chunks "
60 temp_file src; // Dummy;
61 filtering_stream<bidirectional> out(
62 combine(file_source(src.name()), file_sink(dest.name(), out_mode))
64 write_data_in_chars(out);
67 compare_files(dest.name(), test.name()),
68 "failed writing to filtering_stream<bidirectional> in chars "
75 temp_file src; // Dummy;
76 filtering_stream<bidirectional> out(
77 combine(file_source(src.name()), file_sink(dest.name(), out_mode))
79 write_data_in_chunks(out);
82 compare_files(dest.name(), test.name()),
83 "failed writing to filtering_stream<bidirectional> in chunks "
89 #endif // #ifndef BOOST_IOSTREAMS_TEST_WRITE_BIDIRECTIONAL_HPP_INCLUDED