aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-06-03 09:50:04 +1000
committerMichael Brasser <michael.brasser@nokia.com>2011-06-03 09:50:04 +1000
commitcd6ebb4912a5d96c788ea0c838d8a1a06ff4029e (patch)
tree315b6191e961c1bb4cab972b62455740c574b15d /tests
parentf97e25abe073bede66cc5683ae45baea3a528d44 (diff)
Replace QPerformanceTimer with QElapsedTimer.
QElapsedTimer has added a nsecsElapsed() function, so QPerformanceTimer is no longer needed. Reviewed-by: Charles Yin
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qperformancetimer/qperformancetimer.pro8
-rw-r--r--tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp68
-rw-r--r--tests/benchmarks/declarative/qdeclarativedebugtrace/qdeclarativedebugtrace.pro8
-rw-r--r--tests/benchmarks/declarative/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp (renamed from tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp)32
-rw-r--r--tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro8
5 files changed, 24 insertions, 100 deletions
diff --git a/tests/auto/declarative/qperformancetimer/qperformancetimer.pro b/tests/auto/declarative/qperformancetimer/qperformancetimer.pro
deleted file mode 100644
index fb0783dfc9..0000000000
--- a/tests/auto/declarative/qperformancetimer/qperformancetimer.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
-SOURCES += tst_qperformancetimer.cpp
-macx:CONFIG -= app_bundle
-
-CONFIG += parallel_test
-
-QT += core-private gui-private declarative-private
diff --git a/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
deleted file mode 100644
index b29ebe3bbc..0000000000
--- a/tests/auto/declarative/qperformancetimer/tst_qperformancetimer.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qperformancetimer_p.h>
-#include <QObject>
-#include <qtest.h>
-
-class tst_qperformancetimer : public QObject
-{
- Q_OBJECT
-
-public:
- tst_qperformancetimer() {}
-
-private slots:
- void units();
-};
-
-void tst_qperformancetimer::units()
-{
- QPerformanceTimer timer;
- timer.start();
- QTest::qWait(300);
- qint64 elapsed = timer.elapsed();
- QVERIFY(elapsed > 300000000 && elapsed < 310000000);
-}
-
-QTEST_MAIN(tst_qperformancetimer)
-
-#include "tst_qperformancetimer.moc"
diff --git a/tests/benchmarks/declarative/qdeclarativedebugtrace/qdeclarativedebugtrace.pro b/tests/benchmarks/declarative/qdeclarativedebugtrace/qdeclarativedebugtrace.pro
new file mode 100644
index 0000000000..e9aea4f71c
--- /dev/null
+++ b/tests/benchmarks/declarative/qdeclarativedebugtrace/qdeclarativedebugtrace.pro
@@ -0,0 +1,8 @@
+load(qttest_p4)
+QT += declarative
+TEMPLATE = app
+TARGET = tst_qdeclarativedebugtrace
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativedebugtrace.cpp
+
diff --git a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/benchmarks/declarative/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp
index e52cd2e573..224e7b471f 100644
--- a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
+++ b/tests/benchmarks/declarative/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include <private/qperformancetimer_p.h>
+#include <QtCore/QElapsedTimer>
#include <QObject>
#include <qtest.h>
-class tst_qperformancetimer : public QObject
+class tst_qdeclarativedebugtrace : public QObject
{
Q_OBJECT
public:
- tst_qperformancetimer() {}
+ tst_qdeclarativedebugtrace() {}
private slots:
void all();
@@ -57,35 +57,35 @@ private slots:
void trace();
};
-void tst_qperformancetimer::all()
+void tst_qdeclarativedebugtrace::all()
{
QBENCHMARK {
- QPerformanceTimer t;
+ QElapsedTimer t;
t.start();
- t.elapsed();
+ t.nsecsElapsed();
}
}
-void tst_qperformancetimer::startElapsed()
+void tst_qdeclarativedebugtrace::startElapsed()
{
- QPerformanceTimer t;
+ QElapsedTimer t;
QBENCHMARK {
t.start();
- t.elapsed();
+ t.nsecsElapsed();
}
}
-void tst_qperformancetimer::doubleElapsed()
+void tst_qdeclarativedebugtrace::doubleElapsed()
{
- QPerformanceTimer t;
+ QElapsedTimer t;
t.start();
QBENCHMARK {
- t.elapsed();
- t.elapsed();
+ t.nsecsElapsed();
+ t.nsecsElapsed();
}
}
-void tst_qperformancetimer::trace()
+void tst_qdeclarativedebugtrace::trace()
{
QString s("A decent sized string of text here.");
QBENCHMARK {
@@ -95,6 +95,6 @@ void tst_qperformancetimer::trace()
}
}
-QTEST_MAIN(tst_qperformancetimer)
+QTEST_MAIN(tst_qdeclarativedebugtrace)
-#include "tst_qperformancetimer.moc"
+#include "tst_qdeclarativedebugtrace.moc"
diff --git a/tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro b/tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro
deleted file mode 100644
index a39cd3d979..0000000000
--- a/tests/benchmarks/declarative/qperformancetimer/qperformancetimer.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-load(qttest_p4)
-QT += declarative
-TEMPLATE = app
-TARGET = tst_qperformancetimer
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_qperformancetimer.cpp
-