OTest2
A C++ testing framework
include
otest2
assertionslexi.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_ASSERTIONSLEXI_H_
21
#define OTest2_INCLUDE_OTEST2_ASSERTIONSLEXI_H_
22
23
#include <
otest2/assertcontext.h
>
24
#include <
otest2/assertionannotation.h
>
25
26
namespace
OTest2
{
27
51
class
LexicographicalAssertion
:
public
AssertContext
{
52
private
:
53
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
IterB_>
54
bool
testAssertLexiList(
55
IterA_ begin_a_,
56
IterA_ end_a_,
57
IterB_ begin_b_,
58
IterB_ end_b_);
59
60
public
:
61
/* -- avoid copying */
62
LexicographicalAssertion
(
63
const
LexicographicalAssertion
&) =
delete
;
64
LexicographicalAssertion
&
operator =
(
65
const
LexicographicalAssertion
&) =
delete
;
66
67
/* -- inherit the constructor - the parent constructor is invoked
68
* from the test suite generated code. */
69
using
AssertContext::AssertContext
;
70
71
/* -- lexicographical assertions */
72
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
IterB_>
73
bool
testAssertLexi
(
74
IterA_ begin_a_,
75
IterA_ end_a_,
76
IterB_ begin_b_,
77
IterB_ end_b_);
78
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
IterB_>
79
bool
testAssertLexi
(
80
const
ContainerA_& a_,
81
IterB_ begin_b_,
82
IterB_ end_b_);
83
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
ContainerB_>
84
bool
testAssertLexi
(
85
IterA_ begin_a_,
86
IterA_ end_a_,
87
const
ContainerB_& b_);
88
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
ContainerB_>
89
bool
testAssertLexi
(
90
const
ContainerA_& a_,
91
const
ContainerB_& b_);
92
};
93
94
namespace
Assertions {
95
107
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
IterB_>
108
bool
testAssertLexi(
109
IterA_ begin_a_,
110
IterA_ end_a_,
111
IterB_ begin_b_,
112
IterB_ end_b_)
113
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::LexicographicalAssertion"
,
"testAssertLexi< ::$1 >"
);
114
125
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
IterB_>
126
bool
testAssertLexi(
127
const
ContainerA_& a_,
128
IterB_ begin_b_,
129
IterB_ end_b_)
130
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::LexicographicalAssertion"
,
"testAssertLexi< ::$1 >"
);
131
142
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
IterA_,
typename
ContainerB_>
143
bool
testAssertLexi(
144
IterA_ begin_a_,
145
IterA_ end_a_,
146
const
ContainerB_& b_)
147
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::LexicographicalAssertion"
,
"testAssertLexi< ::$1 >"
);
148
158
template
<
template
<
typename
,
typename
>
class
Compare_,
typename
ContainerA_,
typename
ContainerB_>
159
bool
testAssertLexi(
160
const
ContainerA_& a_,
161
const
ContainerB_& b_)
162
TEST_ASSERTION_MARK_TMPL
(
"::OTest2::LexicographicalAssertion"
,
"testAssertLexi< ::$1 >"
);
163
164
}
/* -- namespace Assertions */
165
166
}
/* -- namespace OTest2 */
167
168
#endif
/* -- OTest2_INCLUDE_OTEST2_ASSERTIONSLEXI_H_ */
OTest2::AssertContext::AssertContext
AssertContext(const AssertContext &)=delete
assertcontext.h
OTest2::LexicographicalAssertion
Implementation of lexicographical container assertions.
Definition:
assertionslexi.h:51
OTest2::LexicographicalAssertion::operator=
LexicographicalAssertion & operator=(const LexicographicalAssertion &)=delete
OTest2::AssertContext
Assertion context.
Definition:
assertcontext.h:37
OTest2::LexicographicalAssertion::LexicographicalAssertion
LexicographicalAssertion(const LexicographicalAssertion &)=delete
TEST_ASSERTION_MARK_TMPL
#define TEST_ASSERTION_MARK_TMPL(class_, method_)
Definition:
assertionannotation.h:26
OTest2
Definition:
assertbean.h:25
assertionannotation.h
OTest2::LexicographicalAssertion::testAssertLexi
bool testAssertLexi(IterA_ begin_a_, IterA_ end_a_, IterB_ begin_b_, IterB_ end_b_)
Definition:
assertionslexiimpl.h:146
Generated by
1.8.17