⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testfailuretest.cpp

📁 这是国外的resip协议栈
💻 CPP
字号:
#include "CoreSuite.h"#include "TestFailureTest.h"#include <cppunit/TestFailure.h>#include <cppunit/Exception.h>CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TestFailureTest,                                       coreSuiteName() );TestFailureTest::TestFailureTest(){}TestFailureTest::~TestFailureTest(){}void TestFailureTest::setUp(){  m_exceptionDestroyed = false;}void TestFailureTest::tearDown(){}void TestFailureTest::testConstructorAndGetters(){  CPPUNIT_NS::TestCase test;  CPPUNIT_NS::Exception *error = new ObservedException( this );  checkTestFailure( &test, error, false );  CPPUNIT_ASSERT( m_exceptionDestroyed );}void TestFailureTest::testConstructorAndGettersForError(){  CPPUNIT_NS::TestCase test;  CPPUNIT_NS::Exception *error = new ObservedException( this );  checkTestFailure( &test, error, true );  CPPUNIT_ASSERT( m_exceptionDestroyed );}void TestFailureTest::exceptionDestroyed(){  m_exceptionDestroyed = true;}void TestFailureTest::checkTestFailure( CPPUNIT_NS::Test *test,                                    CPPUNIT_NS::Exception *error,                                   bool isError ){  CPPUNIT_NS::TestFailure failure( test, error, isError );  CPPUNIT_ASSERT_EQUAL( test, failure.failedTest() );  CPPUNIT_ASSERT_EQUAL( error, failure.thrownException() );  CPPUNIT_ASSERT_EQUAL( isError, failure.isError() );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -