summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtsensors5
diff options
context:
space:
mode:
authorLincoln Ramsay <lincoln.ramsay@nokia.com>2012-08-17 11:51:21 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-09 20:35:30 +0200
commitceb982907c98d2e71e1d7b84c87b06328c6c391f (patch)
treedfd94bef83dc61c481edaac6b82f84835c1092a6 /tests/auto/qtsensors5
parent3c599b87f33673932a55f3f5621073885dea5bc1 (diff)
Remove the QtSensors 5.0 import
The gesture tests that were part of the sensors2 unit test have been retained. The tilt sensor tests were not, though they could be used as a base to make a unit test for the new tilt sensor class. Change any existing imports to use QtMobility.sensors 1.3. Change-Id: I8a7130b3c73980fdd577e96c10aecda15e79f8b2 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'tests/auto/qtsensors5')
-rw-r--r--tests/auto/qtsensors5/tst_qtsensors5.cpp92
1 files changed, 0 insertions, 92 deletions
diff --git a/tests/auto/qtsensors5/tst_qtsensors5.cpp b/tests/auto/qtsensors5/tst_qtsensors5.cpp
index 92b89c92..719876fd 100644
--- a/tests/auto/qtsensors5/tst_qtsensors5.cpp
+++ b/tests/auto/qtsensors5/tst_qtsensors5.cpp
@@ -60,98 +60,6 @@ private slots:
void cleanupTestCase()
{
}
-
- void versions_data()
- {
- QTest::addColumn<QString>("version");
- QTest::addColumn<bool>("exists");
-
- QTest::newRow("5.0") << "5.0" << true;
- }
-
- void versions()
- {
- QFETCH(QString, version);
- QFETCH(bool, exists);
-
- QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtSensors %1\nItem {}").arg(version);
- QQmlComponent c(&engine);
- c.setData(qml.toLocal8Bit(), QUrl::fromLocalFile(QDir::currentPath()));
- if (!exists)
- QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
- QObject *obj = c.create();
- QCOMPARE(exists, (obj != 0));
- delete obj;
- QList<QQmlError> errors = c.errors();
- if (exists) {
- QCOMPARE(errors.count(), 0);
- } else {
- QCOMPARE(errors.count(), 1);
- QString expected = QString("module \"QtSensors\" version %1 is not installed").arg(version);
- QString actual = errors.first().description();
- QCOMPARE(expected, actual);
- }
- }
-
- void elements_data()
- {
- QTest::addColumn<QString>("version");
- QTest::addColumn<QString>("element");
- QTest::addColumn<bool>("exists");
-
- QTest::newRow("5.0 AmbientLightSensor") << "5.0" << "AmbientLightSensor" << true;
- QTest::newRow("5.0 ProximitySensor") << "5.0" << "ProximitySensor" << true;
- QTest::newRow("5.0 TiltSensor") << "5.0" << "TiltSensor" << true;
- QTest::newRow("5.0 SensorGesture") << "5.0" << "SensorGesture" << true;
- }
-
- void elements()
- {
- QFETCH(QString, version);
- QFETCH(QString, element);
- QFETCH(bool, exists);
-
- QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtSensors %1\n%2 {}").arg(version).arg(element);
- QQmlComponent c(&engine);
- c.setData(qml.toLocal8Bit(), QUrl::fromLocalFile(QDir::currentPath()));
- if (!exists)
- QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
- QObject *obj = c.create();
- QCOMPARE(exists, (obj != 0));
- delete obj;
- QList<QQmlError> errors = c.errors();
- QCOMPARE(errors.count(), 0);
- }
-
- void uncreatable_elements_data()
- {
- QTest::addColumn<QString>("version");
- QTest::addColumn<QString>("element");
-
- QTest::newRow("5.0 Sensor") << "5.0" << "Sensor";
- }
-
- void uncreatable_elements()
- {
- QFETCH(QString, version);
- QFETCH(QString, element);
-
- QQmlEngine engine;
- QString qml = QString("import QtQuick 2.0\nimport QtSensors %1\n%2 {}").arg(version).arg(element);
- QQmlComponent c(&engine);
- c.setData(qml.toLocal8Bit(), QUrl::fromLocalFile(QDir::currentPath()));
- //QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
- QObject *obj = c.create();
- QCOMPARE(obj, static_cast<QObject*>(0));
- delete obj;
- QList<QQmlError> errors = c.errors();
- QCOMPARE(errors.count(), 1);
- QString expected = QString("Cannot create %1").arg(element);
- QString actual = errors.first().description();
- QCOMPARE(expected, actual);
- }
};
QTEST_MAIN(tst_qtsensors5)