diff options
Diffstat (limited to 'tests/auto/qml/qml_quick/tst_sensors_basic.qml')
-rw-r--r-- | tests/auto/qml/qml_quick/tst_sensors_basic.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qml_quick/tst_sensors_basic.qml b/tests/auto/qml/qml_quick/tst_sensors_basic.qml index 687382ee..38bde570 100644 --- a/tests/auto/qml/qml_quick/tst_sensors_basic.qml +++ b/tests/auto/qml/qml_quick/tst_sensors_basic.qml @@ -201,4 +201,26 @@ TestCase { {tag: "IRProximitySensor", initialReading: {reflectance: 0.5}, newReading: {reflectance: 0.6}} ]; } + + function test_SupportedFeatures() + { + var sensor = Qt.createQmlObject("import QtSensors; Accelerometer \ + {identifier: \"QAccelerometer\"}", + testCase); + verify(sensor.start()) + verify(sensor.connectedToBackend) + + // According to isFeatureSupported() override implementation in test_backends.h, + // only SkipDuplicates should be supported afterwards + verify(!sensor.isFeatureSupported(Sensor.Buffering)) + verify(!sensor.isFeatureSupported(Sensor.AlwaysOn)) + verify(!sensor.isFeatureSupported(Sensor.GeoValues)) + verify(!sensor.isFeatureSupported(Sensor.FieldOfView)) + verify(!sensor.isFeatureSupported(Sensor.AccelerationMode)) + verify(sensor.isFeatureSupported(Sensor.SkipDuplicates)) + verify(!sensor.isFeatureSupported(Sensor.AxesOrientation)) + verify(!sensor.isFeatureSupported(Sensor.PressureSensorTemperature)) + + sensor.destroy() + } } |