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_SEEK_HPP_INCLUDED
9 #define BOOST_IOSTREAMS_TEST_SEEK_HPP_INCLUDED
12 #include <boost/config.hpp> // BOOST_MSVC, make sure size_t is in std.
13 #include <cstddef> // std::size_t.
15 #include <boost/iostreams/device/array.hpp>
16 #include <boost/iostreams/filtering_stream.hpp>
17 #include <boost/test/test_tools.hpp>
18 #include "../example/container_device.hpp" // We use container_device instead
19 #include "detail/verification.hpp" // of make_iterator_range to
20 // reduce dependence on Boost.Range
25 using namespace boost;
26 using namespace boost::iostreams;
27 using namespace boost::iostreams::example;
28 using namespace boost::iostreams::test;
31 string test(data_reps * data_length(), '\0');
32 filtering_stream<seekable> io;
33 io.push(container_device<string>(test));
35 test_seekable_in_chars(io),
36 "failed seeking within a filtering_stream<seekable>, in chars"
41 string test(data_reps * data_length(), '\0');
42 filtering_stream<seekable> io;
43 io.push(container_device<string>(test));
45 test_seekable_in_chunks(io),
46 "failed seeking within a filtering_stream<seekable>, in chunks"
51 #endif // #ifndef BOOST_IOSTREAMS_TEST_SEEK_HPP_INCLUDED