summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/unittest-cpp/tests/TestTestResults.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/unittest-cpp/tests/TestTestResults.cpp')
-rw-r--r--3rdparty/unittest-cpp/tests/TestTestResults.cpp111
1 files changed, 0 insertions, 111 deletions
diff --git a/3rdparty/unittest-cpp/tests/TestTestResults.cpp b/3rdparty/unittest-cpp/tests/TestTestResults.cpp
deleted file mode 100644
index a1156874676..00000000000
--- a/3rdparty/unittest-cpp/tests/TestTestResults.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-#include "UnitTest++/UnitTestPP.h"
-#include "UnitTest++/TestResults.h"
-#include "RecordingReporter.h"
-
-using namespace UnitTest;
-
-namespace {
-
-TestDetails const details("testname", "suitename", "filename", 123);
-
-
-TEST(StartsWithNoTestsRun)
-{
- TestResults results;
- CHECK_EQUAL (0, results.GetTotalTestCount());
-}
-
-TEST(RecordsNumbersOfTests)
-{
- TestResults results;
- results.OnTestStart(details);
- results.OnTestStart(details);
- results.OnTestStart(details);
- CHECK_EQUAL(3, results.GetTotalTestCount());
-}
-
-TEST(StartsWithNoTestsFailing)
-{
- TestResults results;
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(RecordsNumberOfFailures)
-{
- TestResults results;
- results.OnTestFailure(details, "");
- results.OnTestFailure(details, "");
- CHECK_EQUAL(2, results.GetFailureCount());
-}
-
-TEST(RecordsNumberOfFailedTests)
-{
- TestResults results;
-
- results.OnTestStart(details);
- results.OnTestFailure(details, "");
- results.OnTestFinish(details, 0);
-
- results.OnTestStart(details);
- results.OnTestFailure(details, "");
- results.OnTestFailure(details, "");
- results.OnTestFailure(details, "");
- results.OnTestFinish(details, 0);
-
- CHECK_EQUAL (2, results.GetFailedTestCount());
-}
-
-TEST(NotifiesReporterOfTestStartWithCorrectInfo)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- results.OnTestStart(details);
-
- CHECK_EQUAL (1, reporter.testRunCount);
- CHECK_EQUAL ("suitename", reporter.lastStartedSuite);
- CHECK_EQUAL ("testname", reporter.lastStartedTest);
-}
-
-TEST(NotifiesReporterOfTestFailureWithCorrectInfo)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
-
- results.OnTestFailure(details, "failurestring");
- CHECK_EQUAL (1, reporter.testFailedCount);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (123, reporter.lastFailedLine);
- CHECK_EQUAL ("suitename", reporter.lastFailedSuite);
- CHECK_EQUAL ("testname", reporter.lastFailedTest);
- CHECK_EQUAL ("failurestring", reporter.lastFailedMessage);
-}
-
-TEST(NotifiesReporterOfCheckFailureWithCorrectInfo)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
-
- results.OnTestFailure(details, "failurestring");
- CHECK_EQUAL (1, reporter.testFailedCount);
-
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (123, reporter.lastFailedLine);
- CHECK_EQUAL ("testname", reporter.lastFailedTest);
- CHECK_EQUAL ("suitename", reporter.lastFailedSuite);
- CHECK_EQUAL ("failurestring", reporter.lastFailedMessage);
-}
-
-TEST(NotifiesReporterOfTestEnd)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
-
- results.OnTestFinish(details, 0.1234f);
- CHECK_EQUAL (1, reporter.testFinishedCount);
- CHECK_EQUAL ("testname", reporter.lastFinishedTest);
- CHECK_EQUAL ("suitename", reporter.lastFinishedSuite);
- CHECK_CLOSE (0.1234f, reporter.lastFinishedTestTime, 0.0001f);
-}
-
-
-}