OTest2
A C++ testing framework
assertionstext.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_ASSERTIONSTEXT_H_
21 #define OTest2_INCLUDE_OTEST2_ASSERTIONSTEXT_H_
22 
23 #include <iosfwd>
24 
25 #include <otest2/assertcontext.h>
27 
28 namespace OTest2 {
29 
31  private:
32  bool testAssertImpl(
33  std::istream& a_,
34  std::istream& b_);
35 
36  public:
37  /* -- avoid copying */
39  const LongTextAssertion&) = delete;
41  const LongTextAssertion&) = delete;
42 
43  /* -- inherit the constructor - the parent constructor is invoked
44  * from the test suite generated code. */
46 
47  /* -- text assertions */
49  std::istream& a_,
50  std::istream& b_);
52  std::istream& a_,
53  const std::string& b_);
55  std::istream& a_,
56  const std::string& file_b_);
58  const std::string& a_,
59  std::istream& b_);
61  const std::string& a_,
62  const std::string& b_);
64  const std::string& a_,
65  const std::string& file_b_);
67  const std::string& file_a_,
68  std::istream& b_);
70  const std::string& file_a_,
71  const std::string& b_);
73  const std::string& file_a_,
74  const std::string& file_b_);
75 };
76 
77 namespace Assertions {
78 
94 bool testAssertLongTextSS(
95  std::istream& a_,
96  std::istream& b_)
97 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextSS);
98 
103 bool testAssertLongTextST(
104  std::istream& a_,
105  const std::string& b_)
106 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextST);
107 
112 bool testAssertLongTextSF(
113  std::istream& a_,
114  const std::string& file_b_)
115 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextSF);
116 
121 bool testAssertLongTextTS(
122  const std::string& a_,
123  std::istream& b_)
124 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextTS);
125 
130 bool testAssertLongTextTT(
131  const std::string& a_,
132  const std::string& b_)
133 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextTT);
134 
139 bool testAssertLongTextTF(
140  const std::string& a_,
141  const std::string& file_b_)
142 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextTF);
143 
148 bool testAssertLongTextFS(
149  const std::string& file_a_,
150  std::istream& b_)
151 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextFS);
152 
157 bool testAssertLongTextFT(
158  const std::string& file_a_,
159  const std::string& b_)
160 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextFT);
161 
166 bool testAssertLongTextFF(
167  const std::string& file_a_,
168  const std::string& file_b_)
169 TEST_ASSERTION_MARK(::OTest2::LongTextAssertion, testAssertLongTextFF);
170 
171 } /* -- namespace Assertions */
172 
173 } /* -- namespace OTest2 */
174 
175 #endif /* -- OTest2_INCLUDE_OTEST2_ASSERTIONSTEXT_H_ */
OTest2::LongTextAssertion::testAssertLongTextFT
bool testAssertLongTextFT(const std::string &file_a_, const std::string &b_)
Definition: assertionstext.cpp:231
OTest2::AssertContext::AssertContext
AssertContext(const AssertContext &)=delete
OTest2::LongTextAssertion::testAssertLongTextTF
bool testAssertLongTextTF(const std::string &a_, const std::string &file_b_)
Definition: assertionstext.cpp:216
OTest2::LongTextAssertion::testAssertLongTextSS
bool testAssertLongTextSS(std::istream &a_, std::istream &b_)
Definition: assertionstext.cpp:181
OTest2::LongTextAssertion::testAssertLongTextTT
bool testAssertLongTextTT(const std::string &a_, const std::string &b_)
Definition: assertionstext.cpp:208
OTest2::LongTextAssertion::operator=
LongTextAssertion & operator=(const LongTextAssertion &)=delete
assertcontext.h
TEST_ASSERTION_MARK
#define TEST_ASSERTION_MARK(class_, method_)
Definition: assertionannotation.h:25
OTest2::LongTextAssertion::testAssertLongTextST
bool testAssertLongTextST(std::istream &a_, const std::string &b_)
Definition: assertionstext.cpp:187
OTest2::AssertContext
Assertion context.
Definition: assertcontext.h:37
OTest2::LongTextAssertion::testAssertLongTextFF
bool testAssertLongTextFF(const std::string &file_a_, const std::string &file_b_)
Definition: assertionstext.cpp:239
OTest2::LongTextAssertion::testAssertLongTextFS
bool testAssertLongTextFS(const std::string &file_a_, std::istream &b_)
Definition: assertionstext.cpp:224
OTest2::LongTextAssertion
Definition: assertionstext.h:30
OTest2
Definition: assertbean.h:25
OTest2::LongTextAssertion::LongTextAssertion
LongTextAssertion(const LongTextAssertion &)=delete
OTest2::LongTextAssertion::testAssertLongTextTS
bool testAssertLongTextTS(const std::string &a_, std::istream &b_)
Definition: assertionstext.cpp:201
assertionannotation.h
OTest2::LongTextAssertion::testAssertLongTextSF
bool testAssertLongTextSF(std::istream &a_, const std::string &file_b_)
Definition: assertionstext.cpp:194