/
jiteman
/
jsd-foreign-libreoffice-cppunit
Обзор
Документация
Войти
/
jiteman
/
jsd-foreign-libreoffice-cppunit
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
examples/cppunittest/XmlOutputterTest.h
78 строк
2 KB
jiteman
initial commit has been done
14 апр 2024, 15:49
14 апр 2024, 15:49
4c53812
Код
Авторство
О чём код?
#ifndef CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H #define CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H #include <cppunit/extensions/HelperMacros.h> #include <deque> #include <cppunit/Test.h> #include <cppunit/TestFailure.h> #include <cppunit/TestResultCollector.h> /*! \class XmlOutputterTest * \brief Unit tests for XmlOutputter. */ class XmlOutputterTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( XmlOutputterTest ); CPPUNIT_TEST( testWriteXmlResultWithNoTest ); CPPUNIT_TEST( testWriteXmlResultWithOneFailure ); CPPUNIT_TEST( testWriteXmlResultWithOneError ); CPPUNIT_TEST( testWriteXmlResultWithOneSuccess ); CPPUNIT_TEST( testWriteXmlResultWithThreeFailureTwoErrorsAndTwoSuccess ); CPPUNIT_TEST( testHook ); CPPUNIT_TEST_SUITE_END(); public: /*! Constructs a XmlOutputterTest object. */ XmlOutputterTest(); /// Destructor. virtual ~XmlOutputterTest(); void setUp(); void tearDown(); void testWriteXmlResultWithNoTest(); void testWriteXmlResultWithOneFailure(); void testWriteXmlResultWithOneError(); void testWriteXmlResultWithOneSuccess(); void testWriteXmlResultWithThreeFailureTwoErrorsAndTwoSuccess(); void testHook(); private: class MockHook; /// Prevents the use of the copy constructor. XmlOutputterTest( const XmlOutputterTest © ); /// Prevents the use of the copy operator. void operator =( const XmlOutputterTest © ); std::string statistics( int tests, int total, int error, int failure ); void addTest( std::string testName ); void addTestFailure( std::string testName, std::string message, CPPUNIT_NS::SourceLine sourceLine = CPPUNIT_NS::SourceLine() ); void addTestError( std::string testName, std::string message, CPPUNIT_NS::SourceLine sourceLine = CPPUNIT_NS::SourceLine() ); void addGenericTestFailure( std::string testName, CPPUNIT_NS::Message message, CPPUNIT_NS::SourceLine sourceLine, bool isError ); CPPUNIT_NS::Test *makeDummyTest( std::string testName ); private: CPPUNIT_NS::TestResultCollector *m_result; std::deque<CPPUNIT_NS::Test *> m_dummyTests; }; #endif // CPPUNITEST_XMLTESTRESULTOUTPUTTERTEST_H