testfailure.h
来自「著名的uncle Bob的Agile software development的」· C头文件 代码 · 共 71 行
H
71 行
#ifndef CPPUNIT_TESTFAILURE_H
#define CPPUNIT_TESTFAILURE_H
#ifndef CPPUNIT_GUARDS_H
#include "Guards.h"
#endif
#ifndef CPPUNIT_EXCEPTION_H
#include "CppUnitException.h"
#endif
class Test;
/*
* A TestFailure collects a failed test together with
* the caught exception.
*
* TestFailure assumes lifetime control for any exception
* passed to it. The lifetime of tests is handled by
* their TestSuite (if they have been added to one) or
* whomever creates them.
*
* see TestResult
* see TestSuite
*
*/
class TestFailure
{
REFERENCEOBJECT (TestFailure)
public:
TestFailure (Test *failedTest, CppUnitException *thrownException);
~TestFailure ();
Test *failedTest ();
CppUnitException *thrownException ();
std::string toString ();
protected:
Test *m_failedTest;
CppUnitException *m_thrownException;
};
// Constructs a TestFailure with the given test and exception.
inline TestFailure::TestFailure (Test *failedTest, CppUnitException *thrownException)
: m_failedTest (failedTest), m_thrownException (thrownException)
{}
// Deletes the owned exception.
inline TestFailure::~TestFailure ()
{ delete m_thrownException; }
// Gets the failed test.
inline Test *TestFailure::failedTest ()
{ return m_failedTest; }
// Gets the thrown exception.
inline CppUnitException *TestFailure::thrownException ()
{ return m_thrownException; }
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?