summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/tst_generic.qml
blob: b51aa8b1207f448f5d62d47fa65da2e5932b7d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick
import QtTest
import QtOpcUa as QtOpcUa

Item {
    TestCase {
        name: "Enum exports to QML"

        function test_enumExports() {
            compare(QtOpcUa.Constants.NodeClass.Method, 4);
            compare(QtOpcUa.Constants.NodeAttribute.DisplayName, 8);
            compare(QtOpcUa.Node.Status.Valid, 0);
            compare(QtOpcUa.Status.Good, 0);
            compare(QtOpcUa.Status.BadUnexpectedError, 0x8001);
            compare(QtOpcUa.Constants.Double, 3);
            compare(QtOpcUa.Constants.Certificate, 2);
            compare(QtOpcUa.DataChangeFilter.DeadbandType.Absolute, 1);
            compare(QtOpcUa.DataChangeFilter.DataChangeTrigger.StatusOrValueOrTimestamp, 2);

            // Test return value of undefined node
            compare(node1.nodeClass, QtOpcUa.Constants.NodeClass.Undefined);
        }

        QtOpcUa.Node {
            id: node1
        }
    }
}