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

Implementation of map assertions. More...

#include <assertionsmap.h>

Inheritance diagram for OTest2::MapAssertion:
Inheritance graph
[legend]
Collaboration diagram for OTest2::MapAssertion:
Collaboration graph
[legend]

Public Member Functions

 MapAssertion (const MapAssertion &)=delete
 
MapAssertionoperator= (const MapAssertion &)=delete
 
template<template< typename, typename > class Compare_, typename ContainerA_ , typename ContainerB_ >
bool testAssertMap (const ContainerA_ &a_, const ContainerB_ &b_)
 
 AssertContext (const AssertContext &)=delete
 
 AssertContext (const Context &context_, const std::string &file_, int lineno_, std::initializer_list< const char * > parameters_)
 Ctor. More...
 
- Public Member Functions inherited from OTest2::AssertContext
 AssertContext (const AssertContext &)=delete
 
AssertContextoperator= (const AssertContext &)=delete
 
 AssertContext (const Context &context_, const std::string &file_, int lineno_, std::initializer_list< const char * > parameters_)
 Ctor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OTest2::AssertContext
 ~AssertContext ()
 Dtor. More...
 
AssertStream enterAssertion (bool result_)
 Enter an assertion. More...
 
bool simpleAssertionImpl (bool condition_, const std::string &message_, bool print_expression_)
 Implementation of a simple assertion. More...
 
const Contextotest2Context () const
 Get the OTest2 context. More...
 

Detailed Description

Implementation of map assertions.

The map assertions check content of map containers in the item-wise manner. Items are paired by their keys.

The default algorithm iterates first and then the second list and checks values in the other list. It's not the most time effective algorithm but it works for ordered maps as well as for unordered maps.

The std::multimap are supported too - items with the same key must keep the same order in both containers.

As the std::unordered_multimap doesn't keep any defined order of items with the same key, the container is supported only in a special case when there are only unique keys inside.

The algorithm is controlled by the MapContainerTrait. The default implementation works with STL-like maps.

Definition at line 48 of file assertionsmap.h.

Constructor & Destructor Documentation

◆ MapAssertion()

OTest2::MapAssertion::MapAssertion ( const MapAssertion )
delete

Member Function Documentation

◆ AssertContext() [1/2]

OTest2::AssertContext::AssertContext
delete

◆ AssertContext() [2/2]

OTest2::AssertContext::AssertContext
explicit

Ctor.

Parameters
context_The OTest2 context
file_filename which the assertion is located in
lineno_line number of the assertion
parameters_Array of strings representing the parameters of the assertion. The initializer list is valid just inside one expression as well as the instance of the assertion context is.

Definition at line 31 of file assertcontext.cpp.

◆ operator=()

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

◆ testAssertMap()

template<template< typename, typename > class Compare_, typename ContainerA_ , typename ContainerB_ >
bool OTest2::MapAssertion::testAssertMap ( const ContainerA_ &  a_,
const ContainerB_ &  b_ 
)

Definition at line 179 of file assertionsmapimpl.h.


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