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 | 24 |
1 files changed, 23 insertions, 1 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..bcb21232 100644 --- a/tests/auto/qml/qml_quick/tst_sensors_basic.qml +++ b/tests/auto/qml/qml_quick/tst_sensors_basic.qml @@ -1,5 +1,5 @@ // Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtTest import QtSensors @@ -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() + } } |