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_SEQUENCE_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_READ_INPUT_SEQUENCE_HPP_INCLUDED
12 #include <boost/iostreams/filtering_stream.hpp>
13 #include <boost/range/iterator_range.hpp>
14 #include <boost/test/test_tools.hpp>
15 #include "detail/sequence.hpp"
16 #include "detail/temp_file.hpp"
17 #include "detail/verification.hpp"
19 void read_input_sequence_test()
22 using namespace boost;
23 using namespace boost::iostreams;
24 using namespace boost::iostreams::test;
30 filtering_stream<input> first(make_iterator_range(seq), 0);
31 ifstream second(file.name().c_str());
33 compare_streams_in_chars(first, second),
34 "failed reading from range_adapter "
35 "in chars with no buffer"
40 filtering_stream<input> first(make_iterator_range(seq), 0);
41 ifstream second(file.name().c_str());
43 compare_streams_in_chunks(first, second),
44 "failed reading from range_adapter "
45 "in chars with no buffer"
50 filtering_stream<input> first(make_iterator_range(seq));
51 ifstream second(file.name().c_str());
53 compare_streams_in_chars(first, second),
54 "failed reading from range_adapter "
55 "in chars with large buffer"
60 filtering_stream<input> first(make_iterator_range(seq));
61 ifstream second(file.name().c_str());
63 compare_streams_in_chunks(first, second),
64 "failed reading from range_adapter "
65 "in chars with large buffer"
70 #endif // #ifndef BOOST_IOSTREAMS_TEST_READ_INPUT_SEQUENCE_HPP_INCLUDED