ZeroErr
zeroerr::TestCase Struct Reference

TestCase is a class that holds the test case information. There are several fields that are used to store the test case information. More...

#include <unittest.h>

Inheritance diagram for zeroerr::TestCase:
Collaboration diagram for zeroerr::TestCase:

Public Member Functions

bool operator< (const TestCase &rhs) const
 Compare the test cases. More...
 
 TestCase (std::string name, std::string file, unsigned line)
 Construct a new Test Case object. More...
 
 TestCase (std::string name, std::string file, unsigned line, std::function< void(TestContext *)> func)
 Construct a new Test Case object. More...
 

Public Attributes

std::string name
 
std::string file
 
unsigned line
 
std::function< void(TestContext *)> func
 
std::vector< TestCase * > subcases
 

Detailed Description

TestCase is a class that holds the test case information. There are several fields that are used to store the test case information.

  • name : The name of the test case.
  • file : The file that the test case is defined.
  • line : The line that the test case is defined.
  • func : The function that will be run to test the test case.
  • subcases : The subcases that are defined in the test case.

Constructor & Destructor Documentation

◆ TestCase() [1/2]

zeroerr::TestCase::TestCase ( std::string  name,
std::string  file,
unsigned  line 
)
inline

Construct a new Test Case object.

Parameters
nameThe name of the test case.
fileThe file that the test case is defined.
lineThe line that the test case is defined.

◆ TestCase() [2/2]

zeroerr::TestCase::TestCase ( std::string  name,
std::string  file,
unsigned  line,
std::function< void(TestContext *)>  func 
)
inline

Construct a new Test Case object.

Parameters
nameThe name of the test case.
fileThe file that the test case is defined.
lineThe line that the test case is defined.
funcThe function that will be run to test the test case.

Member Function Documentation

◆ operator<()

bool zeroerr::TestCase::operator< ( const TestCase rhs) const

Compare the test cases.

Parameters
rhsThe test case that will be compared.
Returns
true If the test case is less than the rhs, otherwise false.

Member Data Documentation

◆ file

std::string zeroerr::TestCase::file

◆ func

std::function<void(TestContext*)> zeroerr::TestCase::func

◆ line

unsigned zeroerr::TestCase::line

◆ name

std::string zeroerr::TestCase::name

◆ subcases

std::vector<TestCase*> zeroerr::TestCase::subcases

The documentation for this struct was generated from the following files: