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

Implementation of item-wise container assertions. More...

#include <assertionsitemwise.h>

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

Public Member Functions

 ItemWiseAssertion (const ItemWiseAssertion &)=delete
 
ItemWiseAssertionoperator= (const ItemWiseAssertion &)=delete
 
template<template< typename, typename > class Compare_, typename IterA_ , typename IterB_ >
bool testAssertItemWise (IterA_ begin_a_, IterA_ end_a_, IterB_ begin_b_, IterB_ end_b_)
 
template<template< typename, typename > class Compare_, typename ContainerA_ , typename IterB_ >
bool testAssertItemWise (const ContainerA_ &a_, IterB_ begin_b_, IterB_ end_b_)
 
template<template< typename, typename > class Compare_, typename IterA_ , typename ContainerB_ >
bool testAssertItemWise (IterA_ begin_a, IterA_ end_a_, const ContainerB_ &b_)
 
template<template< typename, typename > class Compare_, typename ContainerA_ , typename ContainerB_ >
bool testAssertItemWise (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 item-wise container assertions.

This assertions apply specified operator on all items in the specified two containers. The assertion passes if all pairs of items passes the operator. Hence, at least both of the containers must be of the same size.

A container passed into the assertions must offer the begin and the end forward iterators. The default behavior is to access the begin() and end() methods. One can write specialization of the ListContainerTrait template to plug non-STL containers in.

Definition at line 40 of file assertionsitemwise.h.

Constructor & Destructor Documentation

◆ ItemWiseAssertion()

OTest2::ItemWiseAssertion::ItemWiseAssertion ( const ItemWiseAssertion )
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=()

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

◆ testAssertItemWise() [1/4]

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

Definition at line 167 of file assertionsitemwiseimpl.h.

◆ testAssertItemWise() [2/4]

template<template< typename, typename > class Compare_, typename ContainerA_ , typename IterB_ >
bool OTest2::ItemWiseAssertion::testAssertItemWise ( const ContainerA_ &  a_,
IterB_  begin_b_,
IterB_  end_b_ 
)

Definition at line 143 of file assertionsitemwiseimpl.h.

◆ testAssertItemWise() [3/4]

template<template< typename, typename > class Compare_, typename IterA_ , typename ContainerB_ >
bool OTest2::ItemWiseAssertion::testAssertItemWise ( IterA_  begin_a,
IterA_  end_a_,
const ContainerB_ &  b_ 
)

Definition at line 155 of file assertionsitemwiseimpl.h.

◆ testAssertItemWise() [4/4]

template<template< typename, typename > class Compare_, typename IterA_ , typename IterB_ >
bool OTest2::ItemWiseAssertion::testAssertItemWise ( IterA_  begin_a_,
IterA_  end_a_,
IterB_  begin_b_,
IterB_  end_b_ 
)

Definition at line 134 of file assertionsitemwiseimpl.h.


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