Index: filtering_stream_test.cpp =================================================================== --- filtering_stream_test.cpp (revision 80898) +++ filtering_stream_test.cpp (working copy) @@ -24,6 +24,7 @@ #include "seek_test.hpp" #include "putback_test.hpp" #include "filtering_stream_flush_test.hpp" +#include "range_filter_test.hpp" using boost::unit_test::test_suite; @@ -48,5 +49,6 @@ test->add(BOOST_TEST_CASE(&seek_test)); test->add(BOOST_TEST_CASE(&putback_test)); test->add(BOOST_TEST_CASE(&test_filtering_ostream_flush)); + test->add(BOOST_TEST_CASE(&range_filter_test)); return test; } Index: range_filter_test.hpp =================================================================== --- range_filter_test.hpp (revision 0) +++ range_filter_test.hpp (working copy) @@ -0,0 +1,45 @@ +// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) +// (C) Copyright 2004-2007 Jonathan Turkanis +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) + +// See http://www.boost.org/libs/iostreams for documentation. + +#ifndef BOOST_IOSTREAMS_TEST_RANGE_FILTER_HPP_INCLUDED +#define BOOST_IOSTREAMS_TEST_RANGE_FILTER_HPP_INCLUDED + +#include +#include + +#include +#include +#include + +namespace +{ + template + std::string read_to_string(Stream& stream) + { + std::ostringstream destStream; + destStream << stream.rdbuf(); + return destStream.str(); + } +} // namespace + +void range_filter_test() +{ + std::istringstream sourceStream("123"); + + typedef std::istream_iterator iterator; + iterator begin(sourceStream); + iterator end; + boost::iterator_range< iterator > range(begin, end); + + boost::iostreams::filtering_stream sourceFilteringStream; + sourceFilteringStream.push(range, 1); + + std::string output = read_to_string(sourceFilteringStream); + BOOST_CHECK_EQUAL("123", output); +} + +#endif // #ifndef BOOST_IOSTREAMS_TEST_RANGE_FILTER_HPP_INCLUDED Index: range_filter_test.hpp =================================================================== --- range_filter_test.hpp (revision 0) +++ range_filter_test.hpp (working copy) Property changes on: range_filter_test.hpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property