OTest2
A C++ testing framework
Classes | Public Member Functions | List of all members
OTest2::TestMarkBuilder Class Reference

Builder of test marks. More...

#include <testmarkbuilder.h>

Classes

struct  Impl
 

Public Member Functions

 TestMarkBuilder ()
 Ctor. More...
 
 ~TestMarkBuilder ()
 Dtor. More...
 
 TestMarkBuilder (const TestMarkBuilder &)=delete
 
TestMarkBuilderoperator= (const TestMarkBuilder &)=delete
 
void setKey (const std::string &key_)
 Set current key. More...
 
void appendMark (TestMarkPtr mark_)
 Append new test mark. More...
 
void appendNull ()
 Append the null mark. More...
 
void appendBool (bool value_)
 Append a boolean mark. More...
 
void appendInt (int64_t value_)
 Append an integer mark. More...
 
void appendFloat (long double value_)
 Append a float mark. More...
 
void appendString (const std::string &value_)
 Append a string mark. More...
 
template<typename ContainerMark_ >
void openContainer (std::unique_ptr< ContainerMark_ > &&container_)
 Open a new nested level of test mark container. More...
 
void openList ()
 Open new nested list. More...
 
void openList (const std::string &prefix_)
 Open new nested list. More...
 
void openMap ()
 Open nested map. More...
 
void openMap (const std::string &prefix_)
 Open nested map. More...
 
void closeContainer ()
 Close currently opened container. More...
 
TestMarkPtr stealMark () const
 Get constructed testmark and reset the builder. More...
 

Detailed Description

Builder of test marks.

Definition at line 37 of file testmarkbuilder.h.

Constructor & Destructor Documentation

◆ TestMarkBuilder() [1/2]

OTest2::TestMarkBuilder::TestMarkBuilder ( )

Ctor.

Definition at line 112 of file testmarkbuilder.cpp.

◆ ~TestMarkBuilder()

OTest2::TestMarkBuilder::~TestMarkBuilder ( )

Dtor.

Definition at line 119 of file testmarkbuilder.cpp.

◆ TestMarkBuilder() [2/2]

OTest2::TestMarkBuilder::TestMarkBuilder ( const TestMarkBuilder )
delete

Member Function Documentation

◆ appendBool()

void OTest2::TestMarkBuilder::appendBool ( bool  value_)

Append a boolean mark.

Parameters
value_The boolean value

Definition at line 138 of file testmarkbuilder.cpp.

◆ appendFloat()

void OTest2::TestMarkBuilder::appendFloat ( long double  value_)

Append a float mark.

Parameters
value_The float value

Definition at line 148 of file testmarkbuilder.cpp.

◆ appendInt()

void OTest2::TestMarkBuilder::appendInt ( int64_t  value_)

Append an integer mark.

Parameters
value_The integer value

Definition at line 143 of file testmarkbuilder.cpp.

◆ appendMark()

void OTest2::TestMarkBuilder::appendMark ( TestMarkPtr  mark_)

Append new test mark.

Parameters
mark_The mark

Definition at line 129 of file testmarkbuilder.cpp.

◆ appendNull()

void OTest2::TestMarkBuilder::appendNull ( )

Append the null mark.

Definition at line 134 of file testmarkbuilder.cpp.

◆ appendString()

void OTest2::TestMarkBuilder::appendString ( const std::string &  value_)

Append a string mark.

Parameters
value_The string value

Definition at line 153 of file testmarkbuilder.cpp.

◆ closeContainer()

void OTest2::TestMarkBuilder::closeContainer ( )

Close currently opened container.

The method closes currently opened container, pops it from the stack and appends it to upper container.

Definition at line 181 of file testmarkbuilder.cpp.

◆ openContainer()

template<typename ContainerMark_ >
void OTest2::TestMarkBuilder::openContainer ( std::unique_ptr< ContainerMark_ > &&  container_)
inline

Open a new nested level of test mark container.

Parameters
container_The nested container

Definition at line 200 of file testmarkbuilder.h.

◆ openList() [1/2]

void OTest2::TestMarkBuilder::openList ( )

Open new nested list.

Definition at line 163 of file testmarkbuilder.cpp.

◆ openList() [2/2]

void OTest2::TestMarkBuilder::openList ( const std::string &  prefix_)

Open new nested list.

Parameters
prefix_Prefix of the list

Definition at line 167 of file testmarkbuilder.cpp.

◆ openMap() [1/2]

void OTest2::TestMarkBuilder::openMap ( )

Open nested map.

Definition at line 172 of file testmarkbuilder.cpp.

◆ openMap() [2/2]

void OTest2::TestMarkBuilder::openMap ( const std::string &  prefix_)

Open nested map.

Parameters
prefix_Prefix of the map

Definition at line 176 of file testmarkbuilder.cpp.

◆ operator=()

TestMarkBuilder& OTest2::TestMarkBuilder::operator= ( const TestMarkBuilder )
delete

◆ setKey()

void OTest2::TestMarkBuilder::setKey ( const std::string &  key_)

Set current key.

Parameters
key_The key

Definition at line 123 of file testmarkbuilder.cpp.

◆ stealMark()

TestMarkPtr OTest2::TestMarkBuilder::stealMark ( ) const

Get constructed testmark and reset the builder.

Warning
The builder must be finished (all containers closed)

Definition at line 187 of file testmarkbuilder.cpp.


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