Home
Base module

Test

Test wrapper class.

Test

#include <icy/test.h>
class Test

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

Subclassed by: FunctionTest

Test wrapper class.

This class is for implementing any kind of unit test that can be executed by a [TestRunner](icy-test-TestRunner.html#testrunner-1).

List of all members

NameKindOwner
TestRunnerfriendDeclared here
namevariableDeclared here
errorsvariableDeclared here
durationvariableDeclared here
TestfunctionDeclared here
~TestfunctionDeclared here
runfunctionDeclared here
passedfunctionDeclared here
TestfunctionDeclared here
operator=functionDeclared here

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

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

  • name 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

Test(const Test & test) = delete

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

Deleted constructor.