基本测试类:Test,TestFixture,TestCase,TestSuite 测试结果记录:SychronizedObject,TestListener,TestResult 错误处理:TestFailure,SourceLine,Execption,NotEqualException 断言:Asserter,TestAssert 2)输出部分(Ouput) 基本部件:Outputter,TestResultCollector 衍生类:TestOutputter,CompilerOutputer,XmlOutputer 3)辅助部分(He...
CPPUNIT_ASSERT(!(money12USD ==money123FF)); }/*test operator!=()*/voidtestOptorNotEqual() {constCMoney money123FF(123,"FF");constCMoney money123USD(123,"USD");constCMoney money12FF(12,"FF");constCMoney money12USD(12,"USD");//checkCPPUNIT_ASSERT(!(money123FF !=money123FF)); ...
CPPUNIT_ASSERT_EQUAL(expected, actual)//确信两者相等 CPPUNIT_ASSERT_EQUAL_MESSAGE(message, expected, actual)//失败的同时打印message CPPUNIT_ASSERT_DOUBLES_EQUAL(expected, actual, delta)//当expected和actual之间差大于delta时失败 要把对fixture的一个测试函数转变成一个测试用例,需要生成一个CppUnit::Test...
CppUnit的组成结构2 核心部分(Core)2.1 基本测试类 Test TestFixture TestCase TestSuite2.2 测试结果记录 SynchronizedObject TestListener TestResult2.3 错误处理 TestFailure SourceLine Exception NotEqualException 2.4 断言 sserter TestAssert 3 输出部分(Output) 3.1 基础部件 Outputter TestResultCollector 3.2 衍生...
// assert(), assertEqual()等等,则需将其设定为1#ifndef CPPUNIT_ENABLE_NAKED_ASSERT#define CPPUNIT_ENABLE_NAKED_ASSERT 0#endif// CPPUNIT_API是在<config_msvc6.h>中被定以的// 若没有被定以,则表明程序不需要引用或生成CppUnit的DLL库#ifndef CPPUNIT_API#define CPPUNIT_API#undef CPPUNIT_NEED...
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected, actual, delta) CPPUNIT_ASSERT_THROW(expression, ExceptionType) CPPUNIT_ASSERT_NO_THROW(expression) CPPUNIT_TEST_SUITE_REGISTRATION(ATestFixtureType) The context of the imported CppUnit test cases will be set to 'project'. ...
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected, actual, delta) CPPUNIT_ASSERT_THROW(expression, ExceptionType) CPPUNIT_ASSERT_NO_THROW(expression) CPPUNIT_TEST_SUITE_REGISTRATION(ATestFixtureType) The context of the imported CppUnit test cases will be set to 'project'. ...
static void Assert::AreNotEqual( float notExpected, float actual, float tolerance, const wchar_t* message = NULL, const __LineInfo* pLineInfo = NULL) 確認兩個 char * 字串不相等C++ 複製 static void Assert::AreNotEqual( const char* notExpected, const char* actual, bool ignoreCase =...
static void Assert::AreNotEqual( float notExpected, float actual, float tolerance, const wchar_t* message = NULL, const __LineInfo* pLineInfo = NULL) 確認兩個 char * 字串不相等C++ 複製 static void Assert::AreNotEqual( const char* notExpected, const char* actual, bool ignoreC...