Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
self_test.h File Reference
#include "lib/lib.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/posix/posix.h"
#include <cxxtest/StdValueTraits.h>
#include <cxxtest/TestSuite.h>
#include "ps/CStr.h"
#include "maths/FixedVector3D.h"
#include "maths/Plane.h"
#include "maths/Vector3D.h"
Include dependency graph for self_test.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CxxTest::ValueTraits< const CStr8 >
 
class  CxxTest::ValueTraits< const CStrW >
 
class  CxxTest::ValueTraits< CFixedVector3D >
 
class  CxxTest::ValueTraits< CVector3D >
 
class  CxxTest::ValueTraits< CPlane >
 

Namespaces

namespace  CxxTest
 

Macros

#define CXXTEST_HAVE_EH
 
#define CXXTEST_HAVE_STD
 
#define TS_ASSERT_OK(expr)   TS_ASSERT_EQUALS((expr), INFO::OK)
 
#define TSM_ASSERT_OK(m, expr)   TSM_ASSERT_EQUALS(m, (expr), INFO::OK)
 
#define TS_ASSERT_STR_EQUALS(str1, str2)   TS_ASSERT_EQUALS(std::string(str1), std::string(str2))
 
#define TSM_ASSERT_STR_EQUALS(m, str1, str2)   TSM_ASSERT_EQUALS(m, std::string(str1), std::string(str2))
 
#define TS_ASSERT_WSTR_EQUALS(str1, str2)   TS_ASSERT_EQUALS(std::wstring(str1), std::wstring(str2))
 
#define TSM_ASSERT_WSTR_EQUALS(m, str1, str2)   TSM_ASSERT_EQUALS(m, std::wstring(str1), std::wstring(str2))
 
#define TS_ASSERT_PATH_EQUALS(path1, path2)   TS_ASSERT_EQUALS((path1).string(), (path2).string())
 
#define TSM_ASSERT_PATH_EQUALS(m, path1, path2)   TSM_ASSERT_EQUALS(m, (path1).string(), (path2).string())
 
#define TS_ASSERT_STR_CONTAINS(str1, str2)   TSM_ASSERT(str1, ts_str_contains(str1, str2))
 
#define TS_ASSERT_STR_NOT_CONTAINS(str1, str2)   TSM_ASSERT(str1, !ts_str_contains(str1, str2))
 
#define TS_ASSERT_WSTR_CONTAINS(str1, str2)   TSM_ASSERT(str1, ts_str_contains(str1, str2))
 
#define TS_ASSERT_WSTR_NOT_CONTAINS(str1, str2)   TSM_ASSERT(str1, !ts_str_contains(str1, str2))
 
#define TS_ASSERT_VECTOR_EQUALS_ARRAY(vec1, array)   TS_ASSERT_EQUALS(vec1, ts_make_vector((array), sizeof(array)))
 
#define TS_ASSERT_VECTOR_CONTAINS(vec1, element)   TS_ASSERT(std::find((vec1).begin(), (vec1).end(), element) != (vec1).end());
 
#define TS_ASSERT_MATRIX_EQUALS_DELTA(m1, m2, size, epsilon)
 
#define TS_ASSERT_MATRIX_DIFFERS_DELTA(m1, m2, size, epsilon)
 

Functions

 CxxTest::CXXTEST_COPY_CONST_TRAITS (CStr8)
 
 CxxTest::CXXTEST_COPY_CONST_TRAITS (CStrW)
 
bool ts_str_contains (const std::string &str1, const std::string &str2)
 
bool ts_str_contains (const std::wstring &str1, const std::wstring &str2)
 
template<typename T >
std::vector< Tts_make_vector (T *start, size_t size_bytes)
 
void ScriptTestSetup (const ScriptInterface &)
 
OsPath DataDir ()
 

Macro Definition Documentation

◆ CXXTEST_HAVE_EH

#define CXXTEST_HAVE_EH

◆ CXXTEST_HAVE_STD

#define CXXTEST_HAVE_STD

◆ TS_ASSERT_MATRIX_DIFFERS_DELTA

#define TS_ASSERT_MATRIX_DIFFERS_DELTA (   m1,
  m2,
  size,
  epsilon 
)
Value:
for (int j = 0; j < size; ++j) \
TS_ASSERT(!feq(m1._data[j], m2._data[j], epsilon));
bool feq(double d1, double d2, double epsilon=0.00001)
are the given floats nearly "equal"?
Definition: lib.h:88

◆ TS_ASSERT_MATRIX_EQUALS_DELTA

#define TS_ASSERT_MATRIX_EQUALS_DELTA (   m1,
  m2,
  size,
  epsilon 
)
Value:
for (int j = 0; j < size; ++j) \
TS_ASSERT_DELTA(m1._data[j], m2._data[j], epsilon);

◆ TS_ASSERT_OK

#define TS_ASSERT_OK (   expr)    TS_ASSERT_EQUALS((expr), INFO::OK)

◆ TS_ASSERT_PATH_EQUALS

#define TS_ASSERT_PATH_EQUALS (   path1,
  path2 
)    TS_ASSERT_EQUALS((path1).string(), (path2).string())

◆ TS_ASSERT_STR_CONTAINS

#define TS_ASSERT_STR_CONTAINS (   str1,
  str2 
)    TSM_ASSERT(str1, ts_str_contains(str1, str2))

◆ TS_ASSERT_STR_EQUALS

#define TS_ASSERT_STR_EQUALS (   str1,
  str2 
)    TS_ASSERT_EQUALS(std::string(str1), std::string(str2))

◆ TS_ASSERT_STR_NOT_CONTAINS

#define TS_ASSERT_STR_NOT_CONTAINS (   str1,
  str2 
)    TSM_ASSERT(str1, !ts_str_contains(str1, str2))

◆ TS_ASSERT_VECTOR_CONTAINS

#define TS_ASSERT_VECTOR_CONTAINS (   vec1,
  element 
)    TS_ASSERT(std::find((vec1).begin(), (vec1).end(), element) != (vec1).end());

◆ TS_ASSERT_VECTOR_EQUALS_ARRAY

#define TS_ASSERT_VECTOR_EQUALS_ARRAY (   vec1,
  array 
)    TS_ASSERT_EQUALS(vec1, ts_make_vector((array), sizeof(array)))

◆ TS_ASSERT_WSTR_CONTAINS

#define TS_ASSERT_WSTR_CONTAINS (   str1,
  str2 
)    TSM_ASSERT(str1, ts_str_contains(str1, str2))

◆ TS_ASSERT_WSTR_EQUALS

#define TS_ASSERT_WSTR_EQUALS (   str1,
  str2 
)    TS_ASSERT_EQUALS(std::wstring(str1), std::wstring(str2))

◆ TS_ASSERT_WSTR_NOT_CONTAINS

#define TS_ASSERT_WSTR_NOT_CONTAINS (   str1,
  str2 
)    TSM_ASSERT(str1, !ts_str_contains(str1, str2))

◆ TSM_ASSERT_OK

#define TSM_ASSERT_OK (   m,
  expr 
)    TSM_ASSERT_EQUALS(m, (expr), INFO::OK)

◆ TSM_ASSERT_PATH_EQUALS

#define TSM_ASSERT_PATH_EQUALS (   m,
  path1,
  path2 
)    TSM_ASSERT_EQUALS(m, (path1).string(), (path2).string())

◆ TSM_ASSERT_STR_EQUALS

#define TSM_ASSERT_STR_EQUALS (   m,
  str1,
  str2 
)    TSM_ASSERT_EQUALS(m, std::string(str1), std::string(str2))

◆ TSM_ASSERT_WSTR_EQUALS

#define TSM_ASSERT_WSTR_EQUALS (   m,
  str1,
  str2 
)    TSM_ASSERT_EQUALS(m, std::wstring(str1), std::wstring(str2))

Function Documentation

◆ DataDir()

OsPath DataDir ( )

◆ ScriptTestSetup()

void ScriptTestSetup ( const ScriptInterface scriptInterface)

◆ ts_make_vector()

template<typename T >
std::vector< T > ts_make_vector ( T start,
size_t  size_bytes 
)

◆ ts_str_contains() [1/2]

bool ts_str_contains ( const std::string &  str1,
const std::string &  str2 
)

◆ ts_str_contains() [2/2]

bool ts_str_contains ( const std::wstring &  str1,
const std::wstring &  str2 
)