Allow ~OutputCheck() to throw so assert behaves as expected

* Required because assertion might throw
* No ABI break because not part of ABI anyways
This commit is contained in:
Martchus 2017-12-11 14:01:40 +01:00
parent db006408b7
commit 37c98b2f91
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ public:
OutputCheck(const std::string &expectedOutput, std::ostream &os = std::cout);
OutputCheck(std::string &&expectedOutput, std::string &&alternativeOutput, std::ostream &os = std::cout);
OutputCheck(std::function<void(const std::string &output)> &&customCheck, std::ostream &os = std::cout);
~OutputCheck();
~OutputCheck() noexcept(false);
private:
std::ostream &m_os;
@ -69,7 +69,7 @@ inline OutputCheck::OutputCheck(std::function<void(const std::string &)> &&custo
/*!
* \brief Asserts the buffered standard output and restores the regular behaviour of std::cout.
*/
inline OutputCheck::~OutputCheck()
inline OutputCheck::~OutputCheck() noexcept(false)
{
m_os.rdbuf(m_regularOutputBuffer);
if (m_customCheck) {