本文整理汇总了C++中TestResult::runCount方法的典型用法代码示例。如果您正苦于以下问题:C++ TestResult::runCount方法的具体用法?C++ TestResult::runCount怎么用?C++ TestResult::runCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestResult
的用法示例。
在下文中一共展示了TestResult::runCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTest
USING_NAMESPACE_CPPUNIT
void TestCallerTest::runTest()
{
#ifdef cu_NO_TEMPLATES
typedef TestCaller(TestCallerTestCase) Caller;
#else
typedef TestCaller<TestCallerTestCase> Caller;
#endif
cu_AUTO_PTR(Caller) test(new TEST_CALLER(TestCallerTestCase, testRun));
const char* testName = "TestCallerTestCase::testRun";
TEST_ASSERT_EQUALS(1, test->countTestCases());
TEST_ASSERT_EQUALS(testName, test->getName());
TEST_ASSERT_EQUALS(testName, test->toString());
TestResult result;
test->run(&result);
TEST_ASSERT(test->fixture()->wasSetUp);
TEST_ASSERT(test->fixture()->wasRun);
TEST_ASSERT(test->fixture()->wasTornDown);
TEST_ASSERT_EQUALS(1, result.runCount());
TEST_ASSERT_EQUALS(1, result.failureCount());
TEST_ASSERT_EQUALS(1, result.errorCount());
TEST_ASSERT(!result.wasSuccessful());
}
示例2: testTearDownError
void TestSetupTest::testTearDownError()
{
TearDownErrorTestSetup
test(new TestCaseTest::FailureTestCase("FailureTestCase"));
TEST_ASSERT_EQUALS(1, test.countTestCases());
TEST_ASSERT_EQUALS("FailureTestCase", test.getName());
TEST_ASSERT_EQUALS("FailureTestCase", test.toString());
TestResult result;
test.run(&result);
TEST_ASSERT(test.wasSetUp);
TEST_ASSERT(!test.wasTornDown);
TEST_ASSERT_EQUALS(1, result.runCount());
TEST_ASSERT_EQUALS(1, result.failureCount());
TEST_ASSERT_EQUALS(1, result.errorCount());
TEST_ASSERT(!result.wasSuccessful());
}
示例3: testTestSetup
USING_NAMESPACE_CPPUNIT
void TestSetupTest::testTestSetup()
{
TestSuite* suite = new TestSuite("2Tests");
suite->addTest(new TestCaseTest::SuccessTestCase("SuccessTestCase"));
suite->addTest(new TestCaseTest::FailureTestCase("FailureTestCase"));
TestTestSetup test(suite);
TEST_ASSERT_EQUALS(2, test.countTestCases());
TEST_ASSERT_EQUALS("2Tests", test.getName());
TEST_ASSERT_EQUALS("suite 2Tests", test.toString());
TestResult result;
test.run(&result);
TEST_ASSERT(test.wasSetUp);
TEST_ASSERT(test.wasTornDown);
TEST_ASSERT_EQUALS(2, result.runCount());
TEST_ASSERT_EQUALS(1, result.failureCount());
TEST_ASSERT_EQUALS(0, result.errorCount());
TEST_ASSERT(!result.wasSuccessful());
}