Base module

Test

Test wrapper class.

#include <icy/test.h>

class Test

Defined in src/base/include/icy/test.h:81

Subclassed by
FunctionTest

This class is for implementing any kind of unit test that can be executed by a TestRunner.

Friends

NameDescription
TestRunnerTests belong to a TestRunner instance.

TestRunner

friend class TestRunner

Defined in src/base/include/icy/test.h:110

Tests belong to a TestRunner instance.

Public Attributes

ReturnNameDescription
std::stringnameThe name of the test.
SErroristerrorsA list of test errors.
doubledurationThe test run duration for benchmarking.

name

std::string name

Defined in src/base/include/icy/test.h:97

The name of the test.


errors

SErrorist errors

Type: SErrorist

Defined in src/base/include/icy/test.h:100

A list of test errors.


duration

double duration

Defined in src/base/include/icy/test.h:103

The test run duration for benchmarking.

Public Methods

ReturnNameDescription
Test
~Test virtualShould remain protected.
voidrun virtualCalled by the TestRunner to run the test.
boolpassedReturn true when the test passed without errors.

Test

Test(const std::string & name = "Unnamed Test")

Defined in src/base/include/icy/test.h:85

Parameters

ParameterTypeDescription
nameconst std::string &Human-readable name displayed in test output.

~Test

virtual

virtual ~Test()

Defined in src/base/include/icy/test.h:88

Should remain protected.


run

virtual

virtual void run()

Defined in src/base/include/icy/test.h:91

Called by the TestRunner to run the test.

Reimplemented by


passed

bool passed()

Defined in src/base/include/icy/test.h:94

Return true when the test passed without errors.

Protected Methods

ReturnNameDescription
TestDeleted constructor.
Test &operator=Deleted assignment operator.

Test

Test(const Test & test) = delete

Defined in src/base/include/icy/test.h:106

Deleted constructor.


operator=

Test & operator=(Test const &) = delete

Defined in src/base/include/icy/test.h:107

Deleted assignment operator.