OTest2
A C++ testing framework
assertbufferbase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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_ASSERTBUFFERBASE_H_
21 #define OTest2_INCLUDE_OTEST2_ASSERTBUFFERBASE_H_
22 
23 #include <otest2/assertbufferstr.h>
24 
25 namespace OTest2 {
26 
34  public:
35  /* -- avoid copying */
37  const AssertBufferBase&) = delete;
39  const AssertBufferBase&) = delete;
40 
45 
49  virtual ~AssertBufferBase();
50 
51  /* -- Empty implementations of assertion functions. User is supposed
52  * to override them. */
53  virtual void assertionOpeningMessage(
54  const Context& context_,
55  const AssertBufferAssertData& data_,
56  const std::string& message_) override;
57  virtual void assertionAdditionalMessage(
58  const Context& context_,
59  const AssertBufferAssertData& data_,
60  const std::string& message_) override;
61  virtual void assertionClose(
62  const Context& context_,
63  const AssertBufferAssertData& data_) override;
64  virtual void errorOpeningMessage(
65  const Context& context_,
66  const std::string& message_) override;
67  virtual void errorAdditionalMessage(
68  const Context& context_,
69  const std::string& message_) override;
70  virtual void errorClose(
71  const Context& context_) override;
72 };
73 
74 } /* -- namespace OTest2 */
75 
76 #endif /* -- OTest2_INCLUDE_OTEST2_ASSERTBUFFERBASE_H_ */
OTest2::AssertBufferBase::errorAdditionalMessage
virtual void errorAdditionalMessage(const Context &context_, const std::string &message_) override
Additional error message.
Definition: assertbufferbase.cpp:57
OTest2::AssertBufferBase::assertionOpeningMessage
virtual void assertionOpeningMessage(const Context &context_, const AssertBufferAssertData &data_, const std::string &message_) override
First composed message of an assertion.
Definition: assertbufferbase.cpp:31
OTest2::AssertBufferBase::operator=
AssertBufferBase & operator=(const AssertBufferBase &)=delete
OTest2::AssertBufferStr
An implementation of the assertion buffer keeping messages in a memory buffer.
Definition: assertbufferstr.h:117
OTest2::AssertBufferBase::~AssertBufferBase
virtual ~AssertBufferBase()
Dtor.
OTest2::AssertBufferBase::assertionAdditionalMessage
virtual void assertionAdditionalMessage(const Context &context_, const AssertBufferAssertData &data_, const std::string &message_) override
Additional assertion message.
Definition: assertbufferbase.cpp:38
OTest2::AssertBufferBase::assertionClose
virtual void assertionClose(const Context &context_, const AssertBufferAssertData &data_) override
Closing of the assertion.
Definition: assertbufferbase.cpp:45
OTest2::AssertBufferBase::errorOpeningMessage
virtual void errorOpeningMessage(const Context &context_, const std::string &message_) override
First composed message of an internal error.
Definition: assertbufferbase.cpp:51
OTest2
Definition: assertbean.h:25
OTest2::AssertBufferBase
An empty implementation of the assertion buffer.
Definition: assertbufferbase.h:33
OTest2::AssertBufferListener
Listener of the string assertion buffer.
Definition: assertbufferstr.h:44
OTest2::AssertBufferBase::AssertBufferBase
AssertBufferBase()
Ctor.
Definition: assertbufferbase.cpp:24
OTest2::AssertBufferBase::errorClose
virtual void errorClose(const Context &context_) override
Closing of the internal error.
Definition: assertbufferbase.cpp:63
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::AssertBufferAssertData
Common data kept for opened assertion.
Definition: assertbufferstr.h:35
assertbufferstr.h