Remove code related to test location.
authorJason McDonald <jason.mcdonald@nokia.com>
Tue, 7 Feb 2012 02:42:05 +0000 (12:42 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 9 Feb 2012 05:29:37 +0000 (06:29 +0100)
Testlib no longer does anything with the test location and neither do
any of Qt's tests, so this code is no longer needed.

Change-Id: Ic370b6b741382a90454c893bffcab4a7328a2f9e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
src/imports/testlib/TestCase.qml
src/qmltest/quicktest.cpp
src/qmltest/quicktestresult.cpp
src/qmltest/quicktestresult_p.h

index a1ab85c..02fa095 100644 (file)
@@ -481,16 +481,12 @@ Item {
     }
 
     function qtest_runFunction(prop, arg) {
-        qtest_results.functionType = TestResult.InitFunc
         qtest_runInternal("init")
         if (!qtest_results.skipped) {
-            qtest_results.functionType = TestResult.Func
             qtest_runInternal(prop, arg)
             qtest_results.finishTestData()
-            qtest_results.functionType = TestResult.CleanupFunc
             qtest_runInternal("cleanup")
         }
-        qtest_results.functionType = TestResult.NoWhere
     }
 
     function qtest_runBenchmarkFunction(prop, arg) {
@@ -499,13 +495,11 @@ Item {
             qtest_results.beginDataRun()
             do {
                 // Run the initialization function.
-                qtest_results.functionType = TestResult.InitFunc
                 qtest_runInternal("init")
                 if (qtest_results.skipped)
                     break
 
                 // Execute the benchmark function.
-                qtest_results.functionType = TestResult.Func
                 if (prop.indexOf("benchmark_once_") != 0)
                     qtest_results.startBenchmark(TestResult.RepeatUntilValidMeasurement, qtest_results.dataTag)
                 else
@@ -520,9 +514,7 @@ Item {
                 qtest_results.stopBenchmark()
 
                 // Run the cleanup function.
-                qtest_results.functionType = TestResult.CleanupFunc
                 qtest_runInternal("cleanup")
-                qtest_results.functionType = TestResult.NoWhere
             } while (!qtest_results.measurementAccepted())
             qtest_results.endDataRun()
         } while (qtest_results.needsMoreMeasurements())
@@ -571,7 +563,6 @@ Item {
 
         // Run the initTestCase function.
         qtest_results.functionName = "initTestCase"
-        qtest_results.functionType = TestResult.InitFunc
         var runTests = true
         if (!qtest_runInternal("initTestCase"))
             runTests = false
@@ -603,7 +594,6 @@ Item {
             }
             qtest_results.functionName = prop
             if (datafunc in testCase) {
-                qtest_results.functionType = TestResult.DataFunc
                 if (qtest_runInternal(datafunc)) {
                     var table = qtest_testCaseResult
                     var haveData = false
@@ -637,7 +627,6 @@ Item {
         // Run the cleanupTestCase function.
         qtest_results.skipped = false
         qtest_results.functionName = "cleanupTestCase"
-        qtest_results.functionType = TestResult.CleanupFunc
         qtest_runInternal("cleanupTestCase")
 
         // Complain about missing functions that we were supposed to run.
index ed5fa7b..551311c 100644 (file)
@@ -142,7 +142,6 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View &
     results.setTestCaseName(fi.baseName());
     results.startLogging();
     results.setFunctionName(QLatin1String("compile"));
-    results.setFunctionType(QuickTestResult::Func);
     // Verbose warning output of all messages and relevant parameters
     QString message;
     QTextStream str(&message);
@@ -176,7 +175,6 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View &
     results.finishTestData();
     results.finishTestFunction();
     results.setFunctionName(QString());
-    results.setFunctionType(QuickTestResult::NoWhere);
     results.stopLogging();
 }
 
index c1c5368..ddfa928 100644 (file)
@@ -163,17 +163,6 @@ void QuickTestResult::setFunctionName(const QString &name)
     emit functionNameChanged();
 }
 
-QuickTestResult::FunctionType QuickTestResult::functionType() const
-{
-    return FunctionType(QTestResult::currentTestLocation());
-}
-
-void QuickTestResult::setFunctionType(FunctionType type)
-{
-    QTestResult::setCurrentTestLocation(QTestResult::TestLocation(type));
-    emit functionTypeChanged();
-}
-
 /*!
     \qmlproperty string TestResult::dataTag
 
index 2c37fab..f6f0c3a 100644 (file)
@@ -56,10 +56,9 @@ class QuickTestResultPrivate;
 class Q_QUICK_TEST_EXPORT QuickTestResult : public QObject
 {
     Q_OBJECT
-    Q_ENUMS(FunctionType RunMode)
+    Q_ENUMS(RunMode)
     Q_PROPERTY(QString testCaseName READ testCaseName WRITE setTestCaseName NOTIFY testCaseNameChanged)
     Q_PROPERTY(QString functionName READ functionName WRITE setFunctionName NOTIFY functionNameChanged)
-    Q_PROPERTY(FunctionType functionType READ functionType WRITE setFunctionType NOTIFY functionTypeChanged)
     Q_PROPERTY(QString dataTag READ dataTag WRITE setDataTag NOTIFY dataTagChanged)
     Q_PROPERTY(bool failed READ isFailed)
     Q_PROPERTY(bool dataFailed READ isDataFailed)
@@ -72,16 +71,6 @@ public:
     QuickTestResult(QObject *parent = 0);
     ~QuickTestResult();
 
-    // Values must match QTestResult::TestLocation.
-    enum FunctionType
-    {
-        NoWhere = 0,
-        DataFunc = 1,
-        InitFunc = 2,
-        Func = 3,
-        CleanupFunc = 4
-    };
-
     // Values must match QBenchmarkIterationController::RunMode.
     enum RunMode
     {
@@ -95,9 +84,6 @@ public:
     QString functionName() const;
     void setFunctionName(const QString &name);
 
-    FunctionType functionType() const;
-    void setFunctionType(FunctionType type);
-
     QString dataTag() const;
     void setDataTag(const QString &tag);
 
@@ -164,7 +150,6 @@ Q_SIGNALS:
     void programNameChanged();
     void testCaseNameChanged();
     void functionNameChanged();
-    void functionTypeChanged();
     void dataTagChanged();
     void skippedChanged();