summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-02-07 12:50:54 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-16 02:00:37 +0100
commit45cf303d3a873ff96cad1e1e8ff736602d0e8a5a (patch)
treec7377533821bf0c3abf7c024c5957ef83964700a /src
parent1b23336a297681dc12700880540a5a8d31f146fe (diff)
Remove code related to test location.
Testlib no longer does anything with the test location, and neither do any of Qt's tests, so the code is no longer needed. Change-Id: I1a464116179f3e26efadad6901f00f3c33e0ce84 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/testlib/qtestcase.cpp8
-rw-r--r--src/testlib/qtestresult.cpp15
-rw-r--r--src/testlib/qtestresult_p.h4
3 files changed, 0 insertions, 27 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 549d16b997..c084441f5c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1499,13 +1499,10 @@ static void qInvokeTestMethodDataEntry(char *slot)
/* Benchmarking: for each accumulation iteration*/
bool invokeOk;
do {
- QTestResult::setCurrentTestLocation(QTestResult::InitFunc);
invokeMethod(QTest::currentTestObject, "init()");
if (QTestResult::skipCurrentTest())
break;
- QTestResult::setCurrentTestLocation(QTestResult::Func);
-
QBenchmarkTestMethodData::current->result = QBenchmarkResult();
QBenchmarkTestMethodData::current->resultAccepted = false;
@@ -1521,10 +1518,8 @@ static void qInvokeTestMethodDataEntry(char *slot)
QTestResult::finishedCurrentTestData();
- QTestResult::setCurrentTestLocation(QTestResult::CleanupFunc);
invokeMethod(QTest::currentTestObject, "cleanup()");
QTestResult::finishedCurrentTestDataCleanup();
- QTestResult::setCurrentTestLocation(QTestResult::NoWhere);
// If this test method has a benchmark, repeat until all measurements are
// acceptable.
@@ -1593,7 +1588,6 @@ static bool qInvokeTestMethod(const char *slotName, const char *data=0)
QTestResult::setCurrentGlobalTestData(gTable->testData(curGlobalDataIndex));
if (curGlobalDataIndex == 0) {
- QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
qsnprintf(member, 512, "%s_data()", slot);
invokeMethod(QTest::currentTestObject, member);
}
@@ -1747,12 +1741,10 @@ static void qInvokeTestMethods(QObject *testObject)
QTEST_ASSERT(metaObject);
QTestLog::startLogging();
QTestResult::setCurrentTestFunction("initTestCase");
- QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
QTestTable::globalTestTable();
invokeMethod(testObject, "initTestCase_data()");
if (!QTestResult::skipCurrentTest() && !QTest::currentTestFailed()) {
- QTestResult::setCurrentTestLocation(QTestResult::InitFunc);
invokeMethod(testObject, "initTestCase()");
// finishedCurrentTestDataCleanup() resets QTestResult::currentTestFailed(), so use a local copy.
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index cfa85eb065..79ea22bb43 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -59,7 +59,6 @@ namespace QTest
static const char *currentTestObjectName = 0;
static bool failed = false;
static bool skipCurrentTest = false;
- static QTestResult::TestLocation location = QTestResult::NoWhere;
static const char *expectFailComment = 0;
static int expectFailMode = 0;
@@ -74,7 +73,6 @@ void QTestResult::reset()
QTest::currentTestFunc = 0;
QTest::currentTestObjectName = 0;
QTest::failed = false;
- QTest::location = QTestResult::NoWhere;
QTest::expectFailComment = 0;
QTest::expectFailMode = 0;
@@ -112,8 +110,6 @@ void QTestResult::setCurrentTestFunction(const char *func)
{
QTest::currentTestFunc = func;
QTest::failed = false;
- if (!func)
- QTest::location = NoWhere;
if (func)
QTestLog::enterTestFunction(func);
}
@@ -152,7 +148,6 @@ void QTestResult::finishedCurrentTestFunction()
{
QTest::currentTestFunc = 0;
QTest::failed = false;
- QTest::location = NoWhere;
QTestLog::leaveTestFunction();
}
@@ -289,16 +284,6 @@ void QTestResult::addSkip(const char *message, const char *file, int line)
QTestLog::addSkip(message, file, line);
}
-QTestResult::TestLocation QTestResult::currentTestLocation()
-{
- return QTest::location;
-}
-
-void QTestResult::setCurrentTestLocation(TestLocation loc)
-{
- QTest::location = loc;
-}
-
void QTestResult::setCurrentTestObject(const char *name)
{
QTest::currentTestObjectName = name;
diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h
index 5c6c4fba90..b060926f2a 100644
--- a/src/testlib/qtestresult_p.h
+++ b/src/testlib/qtestresult_p.h
@@ -63,14 +63,11 @@ class QTestData;
class Q_TESTLIB_EXPORT QTestResult
{
public:
- enum TestLocation { NoWhere = 0, DataFunc = 1, InitFunc = 2, Func = 3, CleanupFunc = 4 };
-
static const char *currentTestObjectName();
static bool currentTestFailed();
static QTestData *currentTestData();
static QTestData *currentGlobalTestData();
static const char *currentTestFunction();
- static TestLocation currentTestLocation();
static const char *currentDataTag();
static const char *currentGlobalDataTag();
static void finishedCurrentTestData();
@@ -86,7 +83,6 @@ public:
static void setCurrentGlobalTestData(QTestData *data);
static void setCurrentTestData(QTestData *data);
static void setCurrentTestFunction(const char *func);
- static void setCurrentTestLocation(TestLocation loc);
static void setCurrentTestObject(const char *name);
static void addSkip(const char *message, const char *file, int line);
static bool expectFail(const char *dataIndex, const char *comment,