summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsensor
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qsensor')
-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();
}