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_READ_BIDIRECTIONAL_STREAMBUF_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_READ_BIDIRECTIONAL_STREAMBUF_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 read_bidirectional_streambuf_test()
21 using namespace boost;
22 using namespace boost::iostreams;
23 using namespace boost::iostreams::test;
30 fb.open(test1.name().c_str(), BOOST_IOS::in);
31 filtering_stream<bidirectional> first(fb, 0);
32 ifstream second(test2.name().c_str());
34 compare_streams_in_chars(first, second),
35 "failed reading from filtering_stream<bidirectional> based on a"
36 "streambuf in chars with no buffer"
42 fb.open(test1.name().c_str(), BOOST_IOS::in);
43 filtering_stream<bidirectional> first(fb, 0);
44 ifstream second(test2.name().c_str());
46 compare_streams_in_chunks(first, second),
47 "failed reading from filtering_stream<bidirectional> based on a"
48 "streambuf in chunks with no buffer"
54 fb.open(test1.name().c_str(), BOOST_IOS::in);
55 filtering_stream<bidirectional> first(fb);
56 ifstream second(test2.name().c_str());
58 compare_streams_in_chars(first, second),
59 "failed reading from filtering_stream<bidirectional> based on a"
60 "streambuf in chars with large buffer"
66 fb.open(test1.name().c_str(), BOOST_IOS::in);
67 filtering_stream<bidirectional> first(fb);
68 ifstream second(test2.name().c_str());
70 compare_streams_in_chunks(first, second),
71 "failed reading from filtering_stream<bidirectional> based on a"
72 "streambuf in chunks with large buffer"
77 #endif // #ifndef BOOST_IOSTREAMS_TEST_READ_BIDIRECTIONAL_STREAMBUF_HPP_INCLUDED