diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-19 11:05:55 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-03-19 11:06:33 +0100 |
commit | 50c16eab20a6d9884ab3149ef59137a10de63e6d (patch) | |
tree | 2684617d911514147283516ddd15803a4049da61 /tests | |
parent | d2cafb8506b798bad7fa56f19557dd6e1cb25cd7 (diff) | |
parent | 879e5536b033302b2ad976750cd2351674e161d6 (diff) | |
download | qtsensors-50c16eab20a6d9884ab3149ef59137a10de63e6d.tar.gz |
Merge branch 'dev' into stable
This starts Qt 5.1 release cycle
Change-Id: Idce0f9b94f9e585abfb6903f554500a06f4f8aaa
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qsensor/test_backends.h | 16 | ||||
-rw-r--r-- | tests/auto/qsensor/tst_qsensor.cpp | 18 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qsensor/test_backends.h b/tests/auto/qsensor/test_backends.h index a36a858..b76d412 100644 --- a/tests/auto/qsensor/test_backends.h +++ b/tests/auto/qsensor/test_backends.h @@ -48,12 +48,16 @@ void register_test_backends(); void unregister_test_backends(); #include <qaccelerometer.h> +#include <qaltimeter.h> #include <qambientlightsensor.h> +#include <qambienttemperaturesensor.h> #include <qcompass.h> #include <qgyroscope.h> +#include <qholstersensor.h> #include <qlightsensor.h> #include <qmagnetometer.h> #include <qorientationsensor.h> +#include <qpressuresensor.h> #include <qproximitysensor.h> #include <qrotationsensor.h> #include <qtapsensor.h> @@ -96,9 +100,15 @@ PREPARE_SENSORINTERFACE(QAccelerometer, QAccelerometerReading, QAccelerometerFil reading->setY(1.0); reading->setZ(1.0); }) +PREPARE_SENSORINTERFACE(QAltimeter, QAltimeterReading, QAltimeterFilter, { + reading->setAltitude(8848); +}) PREPARE_SENSORINTERFACE(QAmbientLightSensor, QAmbientLightReading, QAmbientLightFilter, { reading->setLightLevel(QAmbientLightReading::Twilight); }) +PREPARE_SENSORINTERFACE(QAmbientTemperatureSensor, QAmbientTemperatureReading, QAmbientTemperatureFilter, { + reading->setTemperature(30); +}) PREPARE_SENSORINTERFACE(QCompass, QCompassReading, QCompassFilter, { reading->setAzimuth(1.0); reading->setCalibrationLevel(1.0); @@ -108,6 +118,9 @@ PREPARE_SENSORINTERFACE(QGyroscope, QGyroscopeReading, QGyroscopeFilter, { reading->setY(1.0); reading->setZ(1.0); }) +PREPARE_SENSORINTERFACE(QHolsterSensor, QHolsterReading, QHolsterFilter, { + reading->setHolstered(true); +}) PREPARE_SENSORINTERFACE(QLightSensor, QLightReading, QLightFilter, { reading->setLux(1.0); }) @@ -120,6 +133,9 @@ PREPARE_SENSORINTERFACE(QMagnetometer, QMagnetometerReading, QMagnetometerFilter PREPARE_SENSORINTERFACE(QOrientationSensor, QOrientationReading, QOrientationFilter, { reading->setOrientation(QOrientationReading::LeftUp); }) +PREPARE_SENSORINTERFACE(QPressureSensor, QPressureReading, QPressureFilter, { + reading->setPressure(1.0); +}) PREPARE_SENSORINTERFACE(QProximitySensor, QProximityReading, QProximityFilter, { reading->setClose(true); }) diff --git a/tests/auto/qsensor/tst_qsensor.cpp b/tests/auto/qsensor/tst_qsensor.cpp index a4591aa..a410f71 100644 --- a/tests/auto/qsensor/tst_qsensor.cpp +++ b/tests/auto/qsensor/tst_qsensor.cpp @@ -847,10 +847,18 @@ private slots: QCOMPARE(reading->z(), 1.0); }) + TEST_SENSORINTERFACE(QAltimeter, QAltimeterReading, { + QCOMPARE(reading->altitude(), 8848.0); + }) + TEST_SENSORINTERFACE(QAmbientLightSensor, QAmbientLightReading, { QCOMPARE(reading->lightLevel(), QAmbientLightReading::Twilight); }) + TEST_SENSORINTERFACE(QAmbientTemperatureSensor, QAmbientTemperatureReading, { + QCOMPARE(reading->temperature(), 30.0); + }) + TEST_SENSORINTERFACE(QCompass, QCompassReading, { QCOMPARE(reading->azimuth(), 1.0); QCOMPARE(reading->calibrationLevel(), 1.0); @@ -862,6 +870,10 @@ private slots: QCOMPARE(reading->z(), 1.0); }) + TEST_SENSORINTERFACE(QHolsterSensor, QHolsterReading, { + QCOMPARE(reading->holstered(), true); + }) + TEST_SENSORINTERFACE(QLightSensor, QLightReading, { QCOMPARE(reading->lux(), 1.0); }) @@ -877,6 +889,10 @@ private slots: QCOMPARE(reading->orientation(), QOrientationReading::LeftUp); }) + TEST_SENSORINTERFACE(QPressureSensor, QPressureReading, { + QCOMPARE(reading->pressure(), 1.0); + }) + TEST_SENSORINTERFACE(QProximitySensor, QProximityReading, { QCOMPARE(reading->close(), true); }) @@ -959,6 +975,7 @@ private slots: QVERIFY(!sensor.isFeatureSupported(QSensor::Buffering)); QVERIFY(!sensor.isFeatureSupported(QSensor::GeoValues)); QVERIFY(!sensor.isFeatureSupported(QSensor::FieldOfView)); + QVERIFY(!sensor.isFeatureSupported(QSensor::AccelerationMode)); // Connect to backend - according to the testsensorimpl implementation, AlwaysOn and // GeoValues should be supported afterwards @@ -968,6 +985,7 @@ private slots: QVERIFY(!sensor.isFeatureSupported(QSensor::Buffering)); QVERIFY(sensor.isFeatureSupported(QSensor::GeoValues)); QVERIFY(!sensor.isFeatureSupported(QSensor::FieldOfView)); + QVERIFY(!sensor.isFeatureSupported(QSensor::AccelerationMode)); } }; |