1 // (C) Copyright Gennadiy Rozental 2001-2008.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision$
12 // Description : output_test_stream class definition
13 // ***************************************************************************
15 #ifndef BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER
16 #define BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER
19 #include <boost/test/detail/global_typedef.hpp>
20 #include <boost/test/utils/wrap_stringstream.hpp>
21 #include <boost/test/predicate_result.hpp>
24 #include <cstddef> // for std::size_t
26 #include <boost/test/detail/suppress_warnings.hpp>
28 //____________________________________________________________________________//
30 // ************************************************************************** //
31 // ************** output_test_stream ************** //
32 // ************************************************************************** //
34 // class to be used to simplify testing of ostream-based output operations
38 namespace test_tools
{
40 class BOOST_TEST_DECL output_test_stream
: public wrap_stringstream::wrapped_stream
{
41 typedef unit_test::const_string const_string
;
42 typedef predicate_result result_type
;
45 explicit output_test_stream( const_string pattern_file_name
= const_string(),
46 bool match_or_save
= true,
47 bool text_or_binary
= true );
50 ~output_test_stream();
53 result_type
is_empty( bool flush_stream
= true );
54 result_type
check_length( std::size_t length
, bool flush_stream
= true );
55 result_type
is_equal( const_string arg_
, bool flush_stream
= true );
56 result_type
match_pattern( bool flush_stream
= true );
70 } // namespace test_tools
74 //____________________________________________________________________________//
76 #include <boost/test/detail/enable_warnings.hpp>
78 #endif // BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER