OTest2
A C++ testing framework
testmarknull.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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_TESTMARKNULL_H_
21 #define OTest2__INCLUDE_OTEST2_TESTMARKNULL_H_
22 
23 #include <otest2/testmark.h>
24 
25 namespace OTest2 {
26 
27 struct CtorMark;
28 
32 class TestMarkNull : public TestMark {
33  private:
34  /* -- test mark interface */
35  virtual TestMarkHashCode doGetHashCode() const noexcept;
36  virtual bool doIsEqual(
37  const TestMark& other_,
38  long double precision_) const;
39  virtual bool doIsEqualValue(
40  const TestMark& other_,
41  long double precision_) const;
42  virtual void doDiffArray(
43  int level_,
44  std::vector<LinearizedRecord>& array_) const;
45  virtual void doLinearizedMark(
46  int level_,
47  const std::string& label_,
48  std::vector<LinearizedRecord>& array_) const;
49  virtual void doPrintOpen(
50  std::ostream& os_,
51  const std::string& prefix_) const;
52  virtual void doPrintClose(
53  std::ostream& os_,
54  const std::string& prefix_) const;
55  virtual void doSerializeMark(
56  TestMarkOut& serializer_) const;
57  virtual void doDeserializeMark(
58  TestMarkFactory& factory_,
59  TestMarkIn& deserializer_);
60 
61  public:
65  TestMarkNull();
66 
70  explicit TestMarkNull(
71  const CtorMark*);
72 
76  virtual ~TestMarkNull();
77 
78  /* -- avoid copying */
80  const TestMarkNull&) = delete;
82  const TestMarkNull&) = delete;
83 
87  static const char* typeMark();
88 };
89 
90 } /* namespace OTest2 */
91 
92 #endif /* OTest2__INCLUDE_OTEST2_TESTMARKNULL_H_ */
OTest2::TestMarkNull::TestMarkNull
TestMarkNull()
Ctor.
Definition: testmarknull.cpp:36
OTest2::TestMarkIn
A generic interface of a testmark deserializer.
Definition: testmarkin.h:35
OTest2::TestMarkNull::typeMark
static const char * typeMark()
Get serialization typemark.
Definition: testmarknull.cpp:49
OTest2::TestMarkHashCode
std::uint64_t TestMarkHashCode
Definition: testmarkhashcode.h:28
OTest2::TestMarkOut
A generic interface of a serializer of test marks.
Definition: testmarkout.h:31
OTest2::TestMarkNull::~TestMarkNull
virtual ~TestMarkNull()
Dtor.
Definition: testmarknull.cpp:45
OTest2
Definition: assertbean.h:25
testmark.h
OTest2::TestMarkNull::operator=
TestMarkNull & operator=(const TestMarkNull &)=delete
OTest2::TestMark
Generic interface of a test mark node.
Definition: testmark.h:41
OTest2::TestMarkFactory
A factory of testmark objects used for deserialization.
Definition: testmarkfactory.h:45
OTest2::TestMarkNull
Test mark node representing a null pointer.
Definition: testmarknull.h:32