NRE_TestSuite.hpp File Reference

Declaration of Tester's API's Object : TestSuite. More...

#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include "../InternalTest/NRE_InternalTest.hpp"

Go to the source code of this file.

Classes

class  NRE::Tester::TestSuite
 Describe the test suite used to store all used-defined test and run them. More...
 

Namespaces

 NRE
 The NearlyRealEngine's global namespace.
 
 Tester
 Tester's API.
 

Functions

void NRE::Tester::fail (std::string const &message)
 
void NRE::Tester::fail (const InternalTest *test, std::string const &message)
 
void NRE::Tester::assertTrue (bool assert, std::string const &message)
 
void NRE::Tester::assertTrue (const InternalTest *test, bool assert, std::string const &message)
 
void NRE::Tester::assertFalse (bool assert, std::string const &message)
 
void NRE::Tester::assertFalse (const InternalTest *test, bool assert, std::string const &message)
 
template<class T >
void NRE::Tester::assertEquals (T const &lhs, T const &rhs, std::string const &message="Equals Assertion Failed")
 
template<class T >
void NRE::Tester::assertEquals (const InternalTest *test, T const &lhs, T const &rhs, std::string const &message="Equals Assertion Failed")
 
template<class T >
void NRE::Tester::assertNotEquals (T const &lhs, T const &rhs, std::string const &message="NotEquals Assertion Failed")
 
template<class T >
void NRE::Tester::assertNotEquals (const InternalTest *test, T const &lhs, T const &rhs, std::string const &message="NotEquals Assertion Failed")
 
template<class T >
void NRE::Tester::assertLesser (T const &lhs, T const &rhs, std::string const &message="Lesser Assertion Failed")
 
template<class T >
void NRE::Tester::assertLesser (const InternalTest *test, T const &lhs, T const &rhs, std::string const &message="Lesser Assertion Failed")
 
template<class T >
void NRE::Tester::assertGreater (T const &lhs, T const &rhs, std::string const &message="Greater Assertion Failed")
 
template<class T >
void NRE::Tester::assertGreater (const InternalTest *test, T const &lhs, T const &rhs, std::string const &message="Greater Assertion Failed")
 
template<class T >
void NRE::Tester::assertLesserOrEquals (T const &lhs, T const &rhs, std::string const &message="Lesser or Equals Assertion Failed")
 
template<class T >
void NRE::Tester::assertLesserOrEquals (const InternalTest *test, T const &lhs, T const &rhs, std::string const &message="Lesser or Equals Assertion Failed")
 
template<class T >
void NRE::Tester::assertGreaterOrEquals (T const &lhs, T const &rhs, std::string const &message="Greater or Equals Assertion Failed")
 
template<class T >
void NRE::Tester::assertGreaterOrEquals (const InternalTest *test, T const &lhs, T const &rhs, std::string const &message="Greater or Equals Assertion Failed")
 
void NRE::Tester::assertNull (const void *ptr, std::string const &message)
 
void NRE::Tester::assertNull (const InternalTest *test, const void *ptr, std::string const &message)
 
void NRE::Tester::assertNotNull (const void *ptr, std::string const &message)
 
void NRE::Tester::assertNotNull (const InternalTest *test, const void *ptr, std::string const &message)
 

Detailed Description

Declaration of Tester's API's Object : TestSuite.

Author
Louis ABEL
Date
18/06/2019

Function Documentation

template<class T >
void NRE::Tester::assertEquals ( T const &  lhs,
T const &  rhs,
std::string const &  message = "Equals Assertion Failed" 
)

Except both input to be equals, use the == operator

Parameters
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertEquals ( const InternalTest test,
T const &  lhs,
T const &  rhs,
std::string const &  message = "Equals Assertion Failed" 
)

Except both input to be equals, use the == operator

Parameters
testthe test for detailed information
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
void NRE::Tester::assertFalse ( bool  assert,
std::string const &  message = "False Assertion Failed" 
)

Except a false as input

Parameters
assertthe assert to test
messagethe message if the assertion fail
void NRE::Tester::assertFalse ( const InternalTest test,
bool  assert,
std::string const &  message = "False Assertion Failed" 
)

Except a false as input

Parameters
testthe test for detailed information
assertthe assert to test
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertGreater ( T const &  lhs,
T const &  rhs,
std::string const &  message = "Greater Assertion Failed" 
)

Except the first input to be greater than the second, use the > operator

Parameters
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertGreater ( const InternalTest test,
T const &  lhs,
T const &  rhs,
std::string const &  message = "Greater Assertion Failed" 
)

Except the first input to be greater than the second, use the > operator

Parameters
testthe test for detailed information
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertGreaterOrEquals ( T const &  lhs,
T const &  rhs,
std::string const &  message = "Greater or Equals Assertion Failed" 
)

Except the first input to be greater than the second, use the >= operator

Parameters
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertGreaterOrEquals ( const InternalTest test,
T const &  lhs,
T const &  rhs,
std::string const &  message = "Greater or Equals Assertion Failed" 
)

Except the first input to be greater than the second, use the >= operator

Parameters
testthe test for detailed information
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertLesser ( T const &  lhs,
T const &  rhs,
std::string const &  message = "Lesser Assertion Failed" 
)

Except the first input to be lesser than the second, use the < operator

Parameters
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertLesser ( const InternalTest test,
T const &  lhs,
T const &  rhs,
std::string const &  message = "Lesser Assertion Failed" 
)

Except the first input to be lesser than the second, use the < operator

Parameters
testthe test for detailed information
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertLesserOrEquals ( T const &  lhs,
T const &  rhs,
std::string const &  message = "Lesser or Equals Assertion Failed" 
)

Except the first input to be lesser than the second, use the <= operator

Parameters
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertLesserOrEquals ( const InternalTest test,
T const &  lhs,
T const &  rhs,
std::string const &  message = "Lesser or Equals Assertion Failed" 
)

Except the first input to be lesser than the second, use the <= operator

Parameters
testthe test for detailed information
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertNotEquals ( T const &  lhs,
T const &  rhs,
std::string const &  message = "NotEquals Assertion Failed" 
)

Except both input to be not equals, use the != operator

Parameters
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
template<class T >
void NRE::Tester::assertNotEquals ( const InternalTest test,
T const &  lhs,
T const &  rhs,
std::string const &  message = "NotEquals Assertion Failed" 
)

Except both input to be not equals, use the != operator

Parameters
testthe test for detailed information
lhsthe left input
rhsthe right input
messagethe message if the assertion fail
void NRE::Tester::assertNotNull ( const void *  ptr,
std::string const &  message = "NotNull Assertion Failed" 
)

Except the input to not be a nullptr

Parameters
ptrthe pointer to test
messagethe message if the assertion fail
void NRE::Tester::assertNotNull ( const InternalTest test,
const void *  ptr,
std::string const &  message = "NotNull Assertion Failed" 
)

Except the input to not be a nullptr

Parameters
testthe test for detailed information
ptrthe pointer to test
messagethe message if the assertion fail
void NRE::Tester::assertNull ( const void *  ptr,
std::string const &  message = "Null Assertion Failed" 
)

Except the input to be a nullptr

Parameters
ptrthe pointer to test
messagethe message if the assertion fail
void NRE::Tester::assertNull ( const InternalTest test,
const void *  ptr,
std::string const &  message = "Null Assertion Failed" 
)

Except the input to be a nullptr

Parameters
testthe test for detailed information
ptrthe pointer to test
messagethe message if the assertion fail
void NRE::Tester::assertTrue ( bool  assert,
std::string const &  message = "True Assertion Failed" 
)

Except a true as input

Parameters
assertthe assert to test
messagethe message if the assertion fail
void NRE::Tester::assertTrue ( const InternalTest test,
bool  assert,
std::string const &  message = "True Assertion Failed" 
)

Except a true as input

Parameters
testthe test for detailed information
assertthe assert to test
messagethe message if the assertion fail
void NRE::Tester::fail ( std::string const &  message = "Fail")

Trigger a fail

Parameters
messagethe fail message
void NRE::Tester::fail ( const InternalTest test,
std::string const &  message = "Fail" 
)

Trigger a fail

Parameters
testthe test for detailed information
messagethe fail message