OTest2
A C++ testing framework
include
otest2
assertionsitemwise.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_ASSERTIONSITEMWISE_H_
21
#define OTest2_INCLUDE_OTEST2_ASSERTIONSITEMWISE_H_
22
23
#include <
otest2/assertcontext.h
>
24
#include <
otest2/assertionannotation.h
>
25
26
namespace
OTest2
{
27
40
class
ItemWiseAssertion
:
public
AssertContext
{
41
private
:
42
template
<
43
template
<
typename
,
typename
>
class
Compare_,
44
typename
IterA_,
45
typename
IterB_>
46
bool
testAssertItemWiseList(
47
IterA_ begin_a_,
48
IterA_ end_a_,
49
IterB_ begin_b_,
50
IterB_ end_b_);
51
52
public
:
53
/* -- avoid copying */
54
ItemWiseAssertion
(
55
const
ItemWiseAssertion
&) =
delete
;
56
ItemWiseAssertion
&
operator =
(
57
const
ItemWiseAssertion
&) =
delete
;
58
59
/* -- inherit the constructor - the parent constructor is invoked
60
* from the test suite generated code. */
61
using
AssertContext::AssertContext
;
62
63
/* -- item-wise assertions */
64
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
IterB_>
65
bool
testAssertItemWise
(
66
IterA_ begin_a_,
67
IterA_ end_a_,
68
IterB_ begin_b_,
69
IterB_ end_b_);
70
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
IterB_>
71
bool
testAssertItemWise
(
72
const
ContainerA_& a_,
73
IterB_ begin_b_,
74
IterB_ end_b_);
75
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
ContainerB_>
76
bool
testAssertItemWise
(
77
IterA_ begin_a,
78
IterA_ end_a_,
79
const
ContainerB_& b_);
80
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
ContainerB_>
81
bool
testAssertItemWise
(
82
const
ContainerA_& a_,
83
const
ContainerB_& b_);
84
};
85
86
namespace
Assertions {
87
98
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
IterB_>
99
bool
testAssertItemWise(
100
IterA_ begin_a_,
101
IterA_ end_a_,
102
IterB_ begin_b_,
103
IterB_ end_b_)
104
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::ItemWiseAssertion"
,
"testAssertItemWise< ::$1 >"
);
105
115
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
IterB_>
116
bool
testAssertItemWise(
117
const
ContainerA_& a_,
118
IterB_ begin_b_,
119
IterB_ end_b_)
120
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::ItemWiseAssertion"
,
"testAssertItemWise< ::$1 >"
);
121
131
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
ContainerB_>
132
bool
testAssertItemWise(
133
IterA_ begin_a_,
134
IterA_ end_a_,
135
const
ContainerB_& b_)
136
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::ItemWiseAssertion"
,
"testAssertItemWise< ::$1 >"
);
137
145
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
ContainerB_>
146
bool
testAssertItemWise(
147
const
ContainerA_& a_,
148
const
ContainerB_& b_)
149
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::ItemWiseAssertion"
,
"testAssertItemWise< ::$1 >"
);
150
151
}
/* -- namespace Assertions */
152
153
}
/* -- namespace OTest2 */
154
155
#endif
/* -- OTest2_INCLUDE_OTEST2_ASSERTIONSITEMWISE_H_ */
OTest2::AssertContext::AssertContext
AssertContext(const AssertContext &)=delete
OTest2::ItemWiseAssertion::ItemWiseAssertion
ItemWiseAssertion(const ItemWiseAssertion &)=delete
assertcontext.h
OTest2::AssertContext
Assertion context.
Definition:
assertcontext.h:37
OTest2::ItemWiseAssertion::operator=
ItemWiseAssertion & operator=(const ItemWiseAssertion &)=delete
TEST_ASSERTION_MARK_TMPL
#define TEST_ASSERTION_MARK_TMPL(class_, method_)
Definition:
assertionannotation.h:26
OTest2
Definition:
assertbean.h:25
OTest2::ItemWiseAssertion::testAssertItemWise
bool testAssertItemWise(IterA_ begin_a_, IterA_ end_a_, IterB_ begin_b_, IterB_ end_b_)
Definition:
assertionsitemwiseimpl.h:134
OTest2::ItemWiseAssertion
Implementation of item-wise container assertions.
Definition:
assertionsitemwise.h:40
assertionannotation.h
Generated by
1.8.17