2011-08-30 19:59:09 +00:00
|
|
|
#include <QtTest/QtTest>
|
|
|
|
|
|
|
|
#include "ReportFileOutput.h"
|
|
|
|
#include "ReportFileOutput_test.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
ReportFileOutputTest::ReportFileOutputTest() : QObject() {}
|
|
|
|
|
|
|
|
void ReportFileOutputTest::testPassed() {
|
|
|
|
stringstream buffer;
|
|
|
|
ReportFileOutput output;
|
|
|
|
|
|
|
|
output.outputIO = &buffer;
|
|
|
|
output.passed("test||done||file.js:23");
|
|
|
|
QVERIFY(buffer.str() == "PASS||test||done||file.js:23\n");
|
|
|
|
QVERIFY(output.successes.size() == 1);
|
|
|
|
QVERIFY(output.failures.size() == 0);
|
|
|
|
}
|
|
|
|
|
2011-09-02 14:24:24 +00:00
|
|
|
void ReportFileOutputTest::testFailed() {
|
|
|
|
stringstream buffer;
|
|
|
|
ReportFileOutput output;
|
|
|
|
|
|
|
|
output.outputIO = &buffer;
|
|
|
|
output.passed("test||done||file.js:23");
|
|
|
|
QVERIFY(buffer.str() == "FAIL||test||done||file.js:23\n");
|
|
|
|
QVERIFY(output.successes.size() == 0);
|
|
|
|
QVERIFY(output.failures.size() == 1);
|
|
|
|
}
|
|
|
|
|
2011-08-30 19:59:09 +00:00
|
|
|
QTEST_MAIN(ReportFileOutputTest);
|
|
|
|
|