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_INPUT_ISTREAM_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_READ_INPUT_ISTREAM_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 read_input_istream_test()
20 using namespace boost;
21 using namespace boost::iostreams;
22 using namespace boost::iostreams::test;
28 ifstream src(test2.name().c_str());
29 filtering_istream first(src, 0);
30 ifstream second(test.name().c_str());
32 compare_streams_in_chars(first, second),
33 "failed reading from filtering_istream based on an istream"
34 "in chars with no buffer"
40 ifstream src(test2.name().c_str());
41 filtering_istream first(src, 0);
42 ifstream second(test.name().c_str());
44 compare_streams_in_chunks(first, second),
45 "failed reading from filtering_istream based on an istream"
46 "in chunks with no buffer"
52 ifstream src(test2.name().c_str());
53 filtering_istream first(src);
54 ifstream second(test.name().c_str());
56 compare_streams_in_chars(first, second),
57 "failed reading from filtering_istream based on an istream"
58 "in chars with large buffer"
64 ifstream src(test2.name().c_str());
65 filtering_istream first(src);
66 ifstream second(test.name().c_str());
68 compare_streams_in_chunks(first, second),
69 "failed reading from filtering_istream based on an istream"
70 "in chunks with large buffer"
75 #endif // #ifndef BOOST_IOSTREAMS_TEST_READ_INPUT_ISTREAM_HPP_INCLUDED