testresult.cpp
来自「计算机软件的测试驱动程序cppunit精简版。」· C++ 代码 · 共 36 行
CPP
36 行
#include "TestResult.h"
#include "Failure.h"
#include <iostream>
void TestResult::testWasRun()
{
testCount++;
}
void TestResult::startTests ()
{
}
void TestResult::addFailure (Failure failure)
{
using namespace std;
cout << failure << endl;
failureCount++;
}
void TestResult::endTests ()
{
using namespace std;
cout << testCount << " tests run" << endl;
if (failureCount > 0)
cout << "There were " << failureCount << " failures" << endl;
else
cout << "There were no test failures" << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?