OTest2
A C++ testing framework
assertionsmap.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Ondrej Starek
3  *
4  * This file is part of OTest2
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2_INCLUDE_OTEST2_ASSERTIONSMAP_H_
21 #define OTest2_INCLUDE_OTEST2_ASSERTIONSMAP_H_
22 
23 #include <otest2/assertcontext.h>
25 
26 namespace OTest2 {
27 
48 class MapAssertion : public AssertContext {
49  private:
50 
51  public:
52  /* -- avoid copying */
54  const MapAssertion&) = delete;
56  const MapAssertion&) = delete;
57 
58  /* -- inherit the constructor - the parent constructor is invoked
59  * from the test suite generated code. */
61 
62  /* -- map assertions */
63  template<template<typename, typename> class Compare_, typename ContainerA_, typename ContainerB_>
64  bool testAssertMap(
65  const ContainerA_& a_,
66  const ContainerB_& b_);
67 };
68 
69 namespace Assertions {
70 
79 template<template<typename, typename> class Compare_, typename ContainerA_, typename ContainerB_>
80 bool testAssertMap(
81  const ContainerA_& a_,
82  const ContainerB_& b_)
83 TEST_ASSERTION_MARK_TMPL("::OTest2::MapAssertion", "testAssertMap< ::$1 >");
84 
85 } /* -- namespace Assertions */
86 
87 } /* -- namespace OTest2 */
88 
89 #endif /* -- OTest2_INCLUDE_OTEST2_ASSERTIONSMAP_H_ */
OTest2::AssertContext::AssertContext
AssertContext(const AssertContext &)=delete
assertcontext.h
OTest2::MapAssertion::MapAssertion
MapAssertion(const MapAssertion &)=delete
OTest2::AssertContext
Assertion context.
Definition: assertcontext.h:37
OTest2::MapAssertion::testAssertMap
bool testAssertMap(const ContainerA_ &a_, const ContainerB_ &b_)
Definition: assertionsmapimpl.h:179
TEST_ASSERTION_MARK_TMPL
#define TEST_ASSERTION_MARK_TMPL(class_, method_)
Definition: assertionannotation.h:26
OTest2
Definition: assertbean.h:25
assertionannotation.h
OTest2::MapAssertion::operator=
MapAssertion & operator=(const MapAssertion &)=delete
OTest2::MapAssertion
Implementation of map assertions.
Definition: assertionsmap.h:48