summaryrefslogtreecommitdiff
path: root/tests/auto/declarative_core/tst_ratings.qml
diff options
context:
space:
mode:
authorJean Gressmann <jean.gressmann@nokia.com>2012-03-28 12:31:25 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-13 02:16:51 +0200
commite3d9598cec4b9ad65cc17511159bdec532587682 (patch)
treea3470abc6123edba76768bac8e2300980b83e316 /tests/auto/declarative_core/tst_ratings.qml
parent8a548008c0786aeed69ddd7f13643a52f18cd389 (diff)
downloadqtlocation-e3d9598cec4b9ad65cc17511159bdec532587682.tar.gz
Routing backend tests for Nokia geoservices plugin
Splits declarative_core into 'frontend' (the current set of tests) and 'backend'. 'Backend' contains routing and geocoding tests against the REST service. This patch only implements the routing tests. Geocoding tests to follow. The new tests are dormant for now, can be activated by providing a suitable /var/lib/qt/qtlocation_tests_configuration.js file. Assuming that the file is present the test will only be run automatically for the Linux/x86 platform. You can manually run the tests by adding qtlocation-backend-tests to CONFIG. Change-Id: I6492c2a8a99594a88dbb1b9f7cf74c6af6d6d0b6 Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
Diffstat (limited to 'tests/auto/declarative_core/tst_ratings.qml')
-rw-r--r--tests/auto/declarative_core/tst_ratings.qml106
1 files changed, 0 insertions, 106 deletions
diff --git a/tests/auto/declarative_core/tst_ratings.qml b/tests/auto/declarative_core/tst_ratings.qml
deleted file mode 100644
index 50472b85..00000000
--- a/tests/auto/declarative_core/tst_ratings.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** 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$
-**
-****************************************************************************/
-
-import QtTest 1.0
-import QtLocation 5.0
-
-TestCase {
- id: testCase
-
- name: "Ratings"
-
- Ratings { id: emptyRatings }
-
- function test_empty() {
- compare(emptyRatings.average, 0.0);
- compare(emptyRatings.maximum, 0.0);
- compare(emptyRatings.count, 0);
- }
-
- Ratings {
- id: qmlRatings
-
- average: 3.5
- maximum: 5.0
- count: 7
- }
-
- function test_qmlConstructedRatings() {
- compare(qmlRatings.average, 3.5);
- compare(qmlRatings.maximum, 5.0);
- compare(qmlRatings.count, 7);
- }
-
- Ratings {
- id: testRatings
- }
-
- function test_setAndGet_data() {
- return [
- { tag: "average", property: "average", signal: "averageChanged", value: 4.5, reset: 0.0 },
- { tag: "maximum", property: "maximum", signal: "maximumChanged", value: 5.0, reset: 0.0 },
- { tag: "count", property: "count", signal: "countChanged", value: 10, reset: 0 },
- ];
- }
-
- function test_setAndGet(data) {
- var signalSpy = Qt.createQmlObject('import QtTest 1.0; SignalSpy {}', testCase, "SignalSpy");
- signalSpy.target = testRatings;
- signalSpy.signalName = data.signal;
-
- // set property to something new
- testRatings[data.property] = data.value;
- compare(testRatings[data.property], data.value);
- compare(signalSpy.count, 1);
-
- // set property to the same value (signal spy should not increase)
- testRatings[data.property] = data.value;
- compare(testRatings[data.property], data.value);
- compare(signalSpy.count, 1);
-
- // reset property
- testRatings[data.property] = data.reset;
- compare(testRatings[data.property], data.reset);
- compare(signalSpy.count, 2);
-
- signalSpy.destroy();
- }
-}