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_SEEKABLE_SEQUENCE_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_READ_SEEKABLE_SEQUENCE_HPP_INCLUDED
12 #include <boost/iostreams/device/file.hpp>
13 #include <boost/iostreams/filtering_stream.hpp>
14 #include <boost/range/iterator_range.hpp>
15 #include <boost/test/test_tools.hpp>
16 #include "detail/sequence.hpp"
17 #include "detail/temp_file.hpp"
18 #include "detail/verification.hpp"
20 void read_seekable_sequence_test()
23 using namespace boost;
24 using namespace boost::iostreams;
25 using namespace boost::iostreams::test;
31 filtering_stream<seekable> first(make_iterator_range(seq), 0);
32 ifstream second(file.name().c_str());
34 compare_streams_in_chars(first, second),
35 "failed reading from filtering_stream<seekable> based on a"
36 "sequence in chars with no buffer"
41 filtering_stream<seekable> first(make_iterator_range(seq), 0);
42 ifstream second(file.name().c_str());
44 compare_streams_in_chunks(first, second),
45 "failed reading from filtering_stream<seekable> based on a"
46 "sequence in chunks with no buffer"
51 filtering_stream<seekable> first(make_iterator_range(seq));
52 ifstream second(file.name().c_str());
54 compare_streams_in_chars(first, second),
55 "failed reading from filtering_stream<seekable> based on a"
56 "sequence in chars with large buffer"
61 filtering_stream<seekable> first(make_iterator_range(seq));
62 ifstream second(file.name().c_str());
64 compare_streams_in_chunks(first, second),
65 "failed reading from filtering_stream<seekable> based on a"
66 "sequence in chunks with large buffer"
71 #endif // #ifndef BOOST_IOSTREAMS_TEST_READ_SEEKABLE_SEQUENCE_HPP_INCLUDED