1#ifndef TESTUTILS_OUTPUTCHECK_H
2#define TESTUTILS_OUTPUTCHECK_H
6#include <cppunit/extensions/HelperMacros.h>
31 const std::
string m_alternativeOutput;
32 std::stringstream m_buffer;
75 m_os.rdbuf(m_regularOutputBuffer);
81 if (m_alternativeOutput.empty()) {
87 CPPUNIT_FAIL(
"Output is not either \"" % m_expectedOutput %
"\" or \"" % m_alternativeOutput %
"\". Got instead:\n" +
actualOutput);
The StandardOutputCheck class asserts whether the (standard) output written in the enclosing code blo...
OutputCheck(std::function< void(const std::string &output)> &&customCheck, std::ostream &os=std::cout)
~OutputCheck() noexcept(false)
Asserts the buffered standard output and restores the regular behaviour of std::cout.
OutputCheck(const std::string &expectedOutput, std::ostream &os=std::cout)
Redirects standard output to an internal buffer.
Contains all utilities provides by the c++utilities library.
IntegralType stringToNumber(const StringType &string, BaseType base=10)
Converts the given string to an unsigned/signed number assuming string uses the specified base.