...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::test_tools::output_test_stream — Class to be used to simplify testing of ostream-based output operations.
// In header: <boost/test/tools/output_test_stream.hpp> class output_test_stream : public wrapped_stream { public: // construct/copy/destruct explicit output_test_stream(const_string = const_string(), bool = true, bool = true); ~output_test_stream(); // public member functions assertion_result is_empty(bool = true); assertion_result check_length(std::size_t, bool = true); assertion_result is_equal(const_string, bool = true); assertion_result match_pattern(bool = true); void flush(); // private member functions std::size_t length(); void sync(); };
output_test_stream
public
construct/copy/destructexplicit output_test_stream(const_string pattern_file_name = const_string(), bool match_or_save = true, bool text_or_binary = true);Constructor.
Parameters: |
|
~output_test_stream();
output_test_stream
public member functionsassertion_result is_empty(bool flush_stream = true);Checks if the stream is empty.
Parameters: |
|
assertion_result check_length(std::size_t length, bool flush_stream = true);Checks the length of the stream.
Parameters: |
|
assertion_result is_equal(const_string arg_, bool flush_stream = true);Checks the content of the stream against a string.
Parameters: |
|
assertion_result match_pattern(bool flush_stream = true);Checks the content of the stream against a pattern file.
Parameters: |
|
void flush();Flushes the stream.