Chris@16: // (C) Copyright Gennadiy Rozental 2001-2008. Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org/libs/test for the library home page. Chris@16: // Chris@16: // File : $RCSfile$ Chris@16: // Chris@101: // Version : $Revision$ Chris@16: // Chris@16: // Description : output_test_stream class definition Chris@16: // *************************************************************************** Chris@16: Chris@16: #ifndef BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER Chris@16: #define BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER Chris@16: Chris@16: // Boost.Test Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: // STL Chris@16: #include // for std::size_t Chris@16: Chris@16: #include Chris@16: Chris@16: //____________________________________________________________________________// Chris@16: Chris@16: // ************************************************************************** // Chris@16: // ************** output_test_stream ************** // Chris@16: // ************************************************************************** // Chris@16: Chris@16: // class to be used to simplify testing of ostream-based output operations Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: namespace test_tools { Chris@16: Chris@16: class BOOST_TEST_DECL output_test_stream : public wrap_stringstream::wrapped_stream { Chris@16: typedef unit_test::const_string const_string; Chris@16: typedef predicate_result result_type; Chris@16: public: Chris@16: // Constructor Chris@16: explicit output_test_stream( const_string pattern_file_name = const_string(), Chris@16: bool match_or_save = true, Chris@16: bool text_or_binary = true ); Chris@16: Chris@16: // Destructor Chris@16: ~output_test_stream(); Chris@16: Chris@16: // checking function Chris@16: result_type is_empty( bool flush_stream = true ); Chris@16: result_type check_length( std::size_t length, bool flush_stream = true ); Chris@16: result_type is_equal( const_string arg_, bool flush_stream = true ); Chris@16: result_type match_pattern( bool flush_stream = true ); Chris@16: Chris@16: // explicit flush Chris@16: void flush(); Chris@16: Chris@16: private: Chris@16: // helper functions Chris@16: std::size_t length(); Chris@16: void sync(); Chris@16: Chris@16: struct Impl; Chris@16: Impl* m_pimpl; Chris@16: }; Chris@16: Chris@16: } // namespace test_tools Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: //____________________________________________________________________________// Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER