Add macro to assert execution of application

This commit is contained in:
Martchus 2016-08-06 22:02:14 +02:00
parent 551867485c
commit b36572a4dd
2 changed files with 10 additions and 3 deletions

View File

@ -13,8 +13,6 @@
#include <vector>
#include <memory>
//#include <bits/codecvt.h>
namespace ConversionUtilities
{

View File

@ -135,13 +135,22 @@ template <typename T> std::ostream &operator<< (std::ostream &out, const AsHexNu
}
/*!
* \brief Wraps the value to be printed using the hex system.
* \brief Wraps a value to be printed using the hex system in the error case when asserted
* with cppunit (or similar test framework).
*/
template <typename T> AsHexNumber<T> asHexNumber(const T &value)
{
return AsHexNumber<T>(value);
}
#ifndef TESTUTILS_ASSERT_EXEC
/*!
* \brief Asserts successful execution of application via TestApplication::execApp(). Output is stored in stdout and stderr.
* \remarks Requires cppunit.
*/
# define TESTUTILS_ASSERT_EXEC(args) CPPUNIT_ASSERT_EQUAL(0, execApp(args, stdout, stderr))
#endif
}
#endif // TESTUTILS_H