Base module

Test

[Test]({#ref classicy_1_1test_1_1Test #}) wrapper class.

Test

#include <icy/test.h>

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).

Public Attributes

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

name

std::string name

The name of the test.


errors

SErrorist errors

A list of test errors.


duration

double duration

The test run duration for benchmarking.

Public Methods

ReturnNameDescription
Test#### Parameters
~Test virtualShould remain protected.
voidrunCalled by the TestRunner to run the test.
boolpassedReturn true when the test passed without errors.

Test

Test(const std::string & name)

Parameters

  • name Human-readable name displayed in test output.

~Test

virtual

virtual ~Test()

Should remain protected.


run

void run()

Called by the TestRunner to run the test.


passed

bool passed()

Return true when the test passed without errors.

Protected Methods

ReturnNameDescription
TestDeleted constructor.

Test

Test(const Test & test) = delete

Deleted constructor.