summaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qml_quick/tst_sensors_basic.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qml_quick/tst_sensors_basic.qml')
-rw-r--r--tests/auto/qml/qml_quick/tst_sensors_basic.qml51
1 files changed, 24 insertions, 27 deletions
diff --git a/tests/auto/qml/qml_quick/tst_sensors_basic.qml b/tests/auto/qml/qml_quick/tst_sensors_basic.qml
index b5cab08b..bcb21232 100644
--- a/tests/auto/qml/qml_quick/tst_sensors_basic.qml
+++ b/tests/auto/qml/qml_quick/tst_sensors_basic.qml
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtSensors module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtTest
import QtSensors
@@ -226,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()
+ }
}