#include <Core/ZTypes.h>
#include <Core/ZErrors.h>
#include <ostream>
#include <sstream>
#include <vector>
#include <cstdio>
#include "CppUnitTest.h"
Go to the source code of this file.
◆ Z_ASSERT
| #define Z_ASSERT |
( |
| condition | ) |
|
Value:
#define Z_ASSERT_MA(condition, customMessage)
Definition ZUnitTest.h:34
◆ Z_ASSERT_ARE_EQUAL
| #define Z_ASSERT_ARE_EQUAL |
( |
| expected, |
|
|
| actual ) |
Value:
#define Z_ASSERT_ARE_EQUAL_MA(expected, actual, customMessage)
Definition ZUnitTest.h:40
◆ Z_ASSERT_ARE_EQUAL_MA
| #define Z_ASSERT_ARE_EQUAL_MA |
( |
| expected, |
|
|
| actual, |
|
|
| customMessage ) |
Value:
{ \
Z_ASSERT_FAILA(Z_TA("<") << (expected) << Z_TA("> == <") << (actual) << Z_TA(">"), customMessage); \
}
static bool AreEqual(const T &expected, const T &actual)
Definition ZUnitTest.h:21
◆ Z_ASSERT_FAILA
| #define Z_ASSERT_FAILA |
( |
| conditionMessage, |
|
|
| customMessage ) |
Value: { \
stream << "Assert " << conditionMessage << " failed. Message: " << customMessage; \
Z_THROW_ERROR_FAILED_MA(stream.str().c_str()); \
}
std::stringstream stringstream
Definition ZUnitTest.h:14
◆ Z_ASSERT_MA
| #define Z_ASSERT_MA |
( |
| condition, |
|
|
| customMessage ) |
Value: if (!(condition)) \
{ \
Z_ASSERT_FAILA(Z_STRINGIZEA(condition), customMessage); \
}
◆ Z_TEST_CLASS
| #define Z_TEST_CLASS |
( |
| name | ) |
|
Value: TEST_CLASS(name) \
{ \
typedef name TheTestClass; \
typedef ZResult (TheTestClass::*TestProc)(); \
void RunTest(TestProc pRunProc) \
{\
ZResult error = (this->*pRunProc)(); \
if (ZFailed(error)) \
{ \
::Microsoft::VisualStudio::CppUnitTestFramework::Assert::Fail(
Zwipe::ErrorToString(error).c_str()); \
} \
} \
public:
string ErrorToString(ZResult error)
Definition ZUnitTest.cpp:5
◆ Z_TEST_CLEANUP_METHOD
| #define Z_TEST_CLEANUP_METHOD |
( |
| name | ) |
|
Value: TEST_METHOD_CLEANUP(name##Proxy) \
{ \
::Microsoft::VisualStudio::CppUnitTestFramework::Assert::AreEqual(Z_OK, name()); \
}\
ZResult name()
◆ Z_TEST_INIT_METHOD
| #define Z_TEST_INIT_METHOD |
( |
| name | ) |
|
Value: TEST_METHOD_INITIALIZE(name##Proxy) \
{ \
::Microsoft::VisualStudio::CppUnitTestFramework::Assert::AreEqual(Z_OK, name()); \
} \
ZResult name()
◆ Z_TEST_LOG
| #define Z_TEST_LOG |
( |
| message | ) |
|
Value: { \
std::stringstream stream; \
stream << message; \
::Microsoft::VisualStudio::CppUnitTestFramework::Logger::WriteMessage(stream.str().c_str()); \
}
◆ Z_TEST_METHOD
| #define Z_TEST_METHOD |
( |
| name | ) |
|
Value: TEST_METHOD(name) \
{ \
RunTest(&TheTestClass::name##Impl); \
} \
ZResult name##Impl()