OTest2
A C++ testing framework
|
Go to the documentation of this file.
32 type(Type::ASSERTION),
34 assert(listener !=
nullptr);
35 setp(tmp_buffer, tmp_buffer + TMP_SIZE);
44 assert(state == State::IDLE);
46 state = State::OPENED;
47 type = Type::ASSERTION;
52 assert(state == State::IDLE);
54 state = State::OPENED;
58 void AssertBufferStr::finishTmpBuffer() {
60 buffer.sputn(tmp_buffer, pptr() - tmp_buffer);
63 setp(tmp_buffer, tmp_buffer + TMP_SIZE);
71 if(c_ != traits_type::eof()) {
72 tmp_buffer[0] = traits_type::to_char_type(c_);
76 return traits_type::not_eof(c_);
100 assert(state != State::IDLE);
106 std::string message_(buffer.str());
112 state = State::ADDITIONAL;
114 case Type::ASSERTION:
125 case State::ADDITIONAL:
127 case Type::ASSERTION:
147 assert(state == State::ADDITIONAL);
151 setp(tmp_buffer, tmp_buffer + TMP_SIZE);
158 case Type::ASSERTION:
Style
Style of shown text.
virtual int overflow(int c_) override final
virtual void assertionClose(const Context &context_, const AssertBufferAssertData &data_)=0
Closing of the assertion.
virtual void setBackground(Color color_) override
Set background color.
void openError()
Open an internal error.
virtual void commitMessage(const Context &context_) override final
Commit (flush) current assertion message.
virtual void setForeground(Color color_) override
Set foreground color.
virtual ~AssertBufferListener()
Dtor.
virtual ~AssertBufferStr()
Dtor.
AssertBufferStr(const AssertBufferStr &)=delete
Color
List of colors supported by the reporters.
Listener of the string assertion buffer.
virtual void setTextStyle(Style style_) override
Set style of the shown text.
virtual void assertionAdditionalMessage(const Context &context_, const AssertBufferAssertData &data_, const std::string &message_)=0
Additional assertion message.
void openAssertion(const AssertBufferAssertData &data_)
Open an assertion.
virtual void errorClose(const Context &context_)=0
Closing of the internal error.
AssertBufferListener()
Ctor.
virtual void errorAdditionalMessage(const Context &context_, const std::string &message_)=0
Additional error message.
virtual void commitAssertion(const Context &context_) override final
Finish current assertion.
virtual void resetAttributes() override
Reset currently set text attributes.
virtual void assertionOpeningMessage(const Context &context_, const AssertBufferAssertData &data_, const std::string &message_)=0
First composed message of an assertion.
Common data kept for opened assertion.
virtual void errorOpeningMessage(const Context &context_, const std::string &message_)=0
First composed message of an internal error.