Lhaz
クラス | 名前空間 | マクロ定義 | 関数 | 変数
WinUnit.h ファイル
#include <windows.h>
#include <tchar.h>
#include <wchar.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale>

[ソースコード]

クラス

class  ¥
 
class  WinUnit::AssertException
 
class  WinUnit::AssertExceptionW< size >
 
class  WinUnit::AssertExceptionA< size >
 
class  WinUnit::Assert
 
class  WinUnit::Environment
 

名前空間

 WinUnit
 

マクロ定義

#define MAX_ASSERT_MESSAGE_LENGTH   1024
 
#define MAX_TRACE_MESSAGE_LENGTH   1024
 
#define MAX_EXPRESSION_STRING   256
 
#define MAX_SYSERROR_STRING   120
 
#define EMIT_ERROR(...)   ¥
 
#define BEGIN_TEST_FUNC(x)   extern "C" __declspec(dllexport) bool __cdecl TEST_##x(wchar_t* __winUnit_buffer, size_t __winUnit_cchBuffer) {
 
#define BEGIN_FIXTURE_BLOCK(fixtureName)   try { FIXTURE_##fixtureName __fixture_##fixtureName;
 
#define BEGIN_TEST_BLOCK   try
 
#define END_TEST_BLOCK   ¥
 
#define END_FIXTURE_BLOCK   ¥
 
#define END_TEST_FUNC   return true; }
 
#define BEGIN_TEST(x)   BEGIN_TEST_FUNC(x) BEGIN_TEST_BLOCK
 
#define END_TEST   END_TEST_BLOCK END_TEST_FUNC
 
#define BEGIN_TESTF(x, f)   BEGIN_TEST_FUNC(x) BEGIN_FIXTURE_BLOCK(f) BEGIN_TEST_BLOCK
 
#define END_TESTF   END_TEST_BLOCK END_FIXTURE_BLOCK END_TEST_FUNC
 
#define WINUNIT_WIDEN2(x)   L ## x
 
#define WINUNIT_WIDEN(x)   WINUNIT_WIDEN2(x)
 
#define __WFILE__   WINUNIT_WIDEN(__FILE__)
 
#define __WFUNCTION__   WINUNIT_WIDEN(__FUNCTION__)
 
#define TSTRING(x)   #x
 
#define __TFILE__   __FILE__
 
#define __TFUNCTION__   __FUNCTION__
 
#define WIN_ASSERT_EQUAL(expected, actual, ...)   WinUnit::Assert::AreEqual(TSTRING(expected), expected, TSTRING(actual), actual, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_NOT_EQUAL(notExpected, actual, ...)   WinUnit::Assert::AreNotEqual(TSTRING(notExpected), notExpected, TSTRING(actual), actual, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_STRING_EQUAL(expected, actual, ...)   WinUnit::Assert::StringEqual(expected, actual, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_ZERO(zeroExpression, ...)   WinUnit::Assert::IsZero(TSTRING(zeroExpression), zeroExpression, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_NOT_ZERO(nonzeroExpression, ...)   WinUnit::Assert::IsNotZero(TSTRING(nonzeroExpression), nonzeroExpression, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_NULL(nullExpression, ...)   WinUnit::Assert::IsNull(TSTRING(nullExpression), nullExpression, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_NOT_NULL(notNullExpression, ...)   WinUnit::Assert::IsNotNull(TSTRING(notNullExpression), notNullExpression, __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_FAIL(message, ...)   WinUnit::Assert::Fail(__TFILE__, __LINE__, message, __VA_ARGS__)
 
#define WIN_ASSERT_TRUE(trueExpression, ...)   WinUnit::Assert::IsTrue(TSTRING(trueExpression), (trueExpression ? true : false), __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_FALSE(falseExpression, ...)   WinUnit::Assert::IsFalse(TSTRING(falseExpression), (falseExpression ? true : false), __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_WINAPI_SUCCESS(trueExpression, ...)   WinUnit::Assert::WinapiSucceeded(TSTRING(trueExpression), (trueExpression ? true : false), __TFILE__, __LINE__, __VA_ARGS__)
 
#define WIN_ASSERT_THROWS(expression, exceptionType, ...)   ¥
 
#define FIXTURE(x)   ¥
 
#define SETUP(x)   void FIXTURE_##x::Setup()
 
#define TEARDOWN(x)   void FIXTURE_##x::Teardown()
 
#define AssertExceptionT   AssertExceptionA<MAX_ASSERT_MESSAGE_LENGTH>
 
#define WIN_TRACE(x, ...)   WinUnit::Trace(x, __VA_ARGS__)
 

関数

 catch (WinUnit::AssertException &e) ¥
 
¥ catch (...) ¥
 
template<class T >
const TCHAR * WinUnit::ToString (const T &object, TCHAR buffer[], size_t bufferSize)
 Size of buffer in TCHARs. [詳解]
 
¥ catch (exceptionType &)
 
template<class T >
const TCHAR * WinUnit::ToString (T *object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const bool &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const signed char &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const unsigned char &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const char &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const __int16 &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const unsigned __int16 &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const __int32 &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const unsigned __int32 &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const long &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const unsigned long &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const __int64 &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const unsigned __int64 &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const float &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const double &object, TCHAR buffer[], size_t bufferSize)
 
template<>
const TCHAR * WinUnit::ToString (const long double &object, TCHAR buffer[], size_t bufferSize)
 
void WinUnit::Trace (const wchar_t *formatString,...)
 Wide-character version of function called by WIN_TRACE macro. [詳解]
 
void WinUnit::Trace (const char *formatString,...)
 ANSI version of function called by WIN_TRACE macro. [詳解]
 

変数

¥ return false
 
¥ try { (expression)
 

詳解

This file contains macros and helper functions to make it easier to write tests. See Test Construction and Assert Macros and Functions for more information.

マクロ定義詳解

#define __TFILE__   __FILE__
#define __TFUNCTION__   __FUNCTION__
#define __WFILE__   WINUNIT_WIDEN(__FILE__)
#define __WFUNCTION__   WINUNIT_WIDEN(__FUNCTION__)
#define AssertExceptionT   AssertExceptionA<MAX_ASSERT_MESSAGE_LENGTH>
#define BEGIN_FIXTURE_BLOCK (   fixtureName)    try { FIXTURE_##fixtureName __fixture_##fixtureName;
#define BEGIN_TEST_BLOCK   try
#define BEGIN_TEST_FUNC (   x)    extern "C" __declspec(dllexport) bool __cdecl TEST_##x(wchar_t* __winUnit_buffer, size_t __winUnit_cchBuffer) {
#define EMIT_ERROR (   ...)    ¥
#define END_FIXTURE_BLOCK   ¥
#define END_TEST_BLOCK   ¥
#define END_TEST_FUNC   return true; }
#define MAX_ASSERT_MESSAGE_LENGTH   1024
#define MAX_EXPRESSION_STRING   256
#define MAX_SYSERROR_STRING   120
#define MAX_TRACE_MESSAGE_LENGTH   1024
#define TSTRING (   x)    #x
#define WINUNIT_WIDEN (   x)    WINUNIT_WIDEN2(x)
#define WINUNIT_WIDEN2 (   x)    L ## x

関数詳解

¥ catch ( WinUnit::AssertException e)
¥ catch (   ...)
¥ catch ( exceptionType &  )

変数詳解

¥ return false
¥ try { (expression)