summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLincoln Ramsay <lincoln.ramsay@nokia.com>2011-10-26 12:57:35 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-28 03:17:22 +0200
commitf3a1b434abcabe3e24a98778bb9f3567d030a17c (patch)
tree44bcc8dd64f20f35d40feb8b58efc62201d98eda /tests/auto
parentfa2fb6be05115af6151fc6e40b809a98ee41e83a (diff)
Add missing test coverage for QIRProximitySensor
Change-Id: I77a8a457d485f76853512063eeae15838929db0a Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Zsolt Simon <zsolt.simon@nokia.com> Sanity-Review: Zsolt Simon <zsolt.simon@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qsensor/test_backends.h4
-rw-r--r--tests/auto/qsensor/tst_qsensor.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qsensor/test_backends.h b/tests/auto/qsensor/test_backends.h
index d58793da..06d7396d 100644
--- a/tests/auto/qsensor/test_backends.h
+++ b/tests/auto/qsensor/test_backends.h
@@ -57,6 +57,7 @@ void unregister_test_backends();
#include <qproximitysensor.h>
#include <qrotationsensor.h>
#include <qtapsensor.h>
+#include <qirproximitysensor.h>
#define PREPARE_SENSORINTERFACE_DECLS(SensorClass, ReadingClass, FilterClass, readingcode)\
class SensorClass ## _impl : public QSensorBackend\
@@ -130,6 +131,9 @@ PREPARE_SENSORINTERFACE(QTapSensor, QTapReading, QTapFilter, {
reading->setTapDirection(QTapReading::Z_Both);
reading->setDoubleTap(true);
})
+PREPARE_SENSORINTERFACE(QIRProximitySensor, QIRProximityReading, QIRProximityFilter, {
+ reading->setReflectance(0.5);
+})
#define TEST_SENSORINTERFACE(SensorClass, ReadingClass, readingcode)\
do {\
diff --git a/tests/auto/qsensor/tst_qsensor.cpp b/tests/auto/qsensor/tst_qsensor.cpp
index 3218d7fc..ff495a07 100644
--- a/tests/auto/qsensor/tst_qsensor.cpp
+++ b/tests/auto/qsensor/tst_qsensor.cpp
@@ -881,6 +881,10 @@ private slots:
QCOMPARE(reading->isDoubleTap(), true);
})
+ TEST_SENSORINTERFACE(QIRProximitySensor, QIRProximityReading, {
+ QCOMPARE(reading->reflectance(), 0.5);
+ })
+
unregister_test_backends();
}