Ocean
Ocean::Test::TestData Class Reference

This class holds the test data necessary for one test iteration combining input data and potential expected test results. More...

Public Types

enum  DataType : uint32_t { DT_INVALID = 0u , DT_VALUE , DT_IMAGE }
 Definition of individual data types. More...
 

Public Member Functions

 TestData ()=default
 Default constructor. More...
 
 TestData (Value &&value, Value &&expectation=Value())
 Creates a new test data object holding a value. More...
 
 TestData (Frame &&image, Value &&expectation)
 Creates a new test data object holding an image. More...
 
DataType dataType () const
 Returns the data type of this test data object. More...
 
const Valuevalue () const
 Returns the value of this object. More...
 
const Frameimage () const
 Returns the image of this object. More...
 
const Valueexpectation () const
 Returns the potential expectation of this test object. More...
 
bool isValid () const
 Returns whether this object is valid and holds valid test data. More...
 
 operator bool () const
 Returns whether this object is valid and holds valid test data. More...
 

Protected Attributes

DataType dataType_ = DT_INVALID
 The data type of this test object. More...
 
Value value_
 The object's value, invalid if not defined. More...
 
Frame image_
 
Value expectation_
 The object's expectation, invalid if not defined. More...
 

Detailed Description

This class holds the test data necessary for one test iteration combining input data and potential expected test results.

Member Enumeration Documentation

◆ DataType

Definition of individual data types.

Enumerator
DT_INVALID 

Invalid data type.

DT_VALUE 

The data is a value.

DT_IMAGE 

The data is an image.

Constructor & Destructor Documentation

◆ TestData() [1/3]

Ocean::Test::TestData::TestData ( )
default

Default constructor.

◆ TestData() [2/3]

Ocean::Test::TestData::TestData ( Value &&  value,
Value &&  expectation = Value() 
)
explicit

Creates a new test data object holding a value.

Parameters
valueThe value of the new object, must be valid
expectationThe optional test expectation for the new object

◆ TestData() [3/3]

Ocean::Test::TestData::TestData ( Frame &&  image,
Value &&  expectation 
)
explicit

Creates a new test data object holding an image.

Parameters
imageThe image of the new object, must be valid
expectationThe optional test expectation for the new object

Member Function Documentation

◆ dataType()

TestData::DataType Ocean::Test::TestData::dataType ( ) const
inline

Returns the data type of this test data object.

Returns
The object's data type

◆ expectation()

const Value & Ocean::Test::TestData::expectation ( ) const
inline

Returns the potential expectation of this test object.

Returns
The object's expectation, invalid if no expectation is defined

◆ image()

const Frame & Ocean::Test::TestData::image ( ) const
inline

Returns the image of this object.

Ensure that dataType() == DT_IMAGE before calling this function.

Returns
The object's image

◆ isValid()

bool Ocean::Test::TestData::isValid ( ) const
inline

Returns whether this object is valid and holds valid test data.

Returns
True, if so

◆ operator bool()

Ocean::Test::TestData::operator bool ( ) const
inlineexplicit

Returns whether this object is valid and holds valid test data.

Returns
True, if so

◆ value()

const Value & Ocean::Test::TestData::value ( ) const
inline

Returns the value of this object.

Ensure that dataType() == DT_VALUE before calling this function.

Returns
The object's value

Field Documentation

◆ dataType_

DataType Ocean::Test::TestData::dataType_ = DT_INVALID
protected

The data type of this test object.

◆ expectation_

Value Ocean::Test::TestData::expectation_
protected

The object's expectation, invalid if not defined.

◆ image_

Frame Ocean::Test::TestData::image_
protected

◆ value_

Value Ocean::Test::TestData::value_
protected

The object's value, invalid if not defined.


The documentation for this class was generated from the following file: