Fingerprint_Card

Loading...
Searching...
No Matches
ZUnitTest.h File Reference
`#include <Core/ZTypes.h>`
`#include <Core/ZErrors.h>`
`#include <ostream>`
`#include <sstream>`
`#include <vector>`
`#include <cstdio>`
`#include "CppUnitTest.h"`
Include dependency graph for ZUnitTest.h:

Go to the source code of this file.

## Classes
class | Zwipe::EqualHelper

## Namespaces
namespace | Zwipe

## Macros
#define | Z_ASSERT_FAILA(conditionMessage, customMessage)
#define | Z_ASSERT_MA(condition, customMessage)
#define | Z_ASSERT(condition)
#define | Z_ASSERT_ARE_EQUAL_MA(expected, actual, customMessage)
#define | Z_ASSERT_ARE_EQUAL(expected, actual)
#define | Z_TEST_CLASS(name)
#define | Z_TEST_METHOD(name)
#define | Z_TEST_INIT_METHOD(name)
#define | Z_TEST_CLEANUP_METHOD(name)
#define | Z_TEST_LOG(message)

## Typedefs
typedef std::wstring | Zwipe::string
typedef std::stringstream | Zwipe::stringstream

## Functions
string | Zwipe::ErrorToString (ZResult error)

## Macro Definition Documentation

## ◆ Z_ASSERT

#define Z_ASSERT | ( |  | condition | ) |

Value:
Z_ASSERT_MA(condition, Z_TA(""))
Z_ASSERT_MA
#define Z_ASSERT_MA(condition, customMessage)
Definition ZUnitTest.h:34

## ◆ Z_ASSERT_ARE_EQUAL

#define Z_ASSERT_ARE_EQUAL | ( |  | expected,
|  |  | actual )

Value:
Z_ASSERT_ARE_EQUAL_MA(expected, actual, Z_TA(""))
Z_ASSERT_ARE_EQUAL_MA
#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:
if (!Zwipe::EqualHelper::AreEqual(expected, actual)) \
{ \
Z_ASSERT_FAILA(Z_TA("<") << (expected) << Z_TA("> == <") << (actual) << Z_TA(">"), customMessage); \
}
Zwipe::EqualHelper::AreEqual
static bool AreEqual(const T &expected, const T &actual)
Definition ZUnitTest.h:21

## ◆ Z_ASSERT_FAILA

#define Z_ASSERT_FAILA | ( |  | conditionMessage,
|  |  | customMessage )

Value:
{ \
Zwipe::stringstream stream; \
stream << "Assert " << conditionMessage << " failed. Message: " << customMessage; \
Z_THROW_ERROR_FAILED_MA(stream.str().c_str()); \
}
Zwipe::stringstream
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:
Zwipe::ErrorToString
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()