diff options
Diffstat (limited to 'tests/auto/client/tabletv2')
-rw-r--r-- | tests/auto/client/tabletv2/.prev_CMakeLists.txt | 33 | ||||
-rw-r--r-- | tests/auto/client/tabletv2/CMakeLists.txt | 29 | ||||
-rw-r--r-- | tests/auto/client/tabletv2/tabletv2.pro | 7 | ||||
-rw-r--r-- | tests/auto/client/tabletv2/tst_tabletv2.cpp | 41 |
4 files changed, 13 insertions, 97 deletions
diff --git a/tests/auto/client/tabletv2/.prev_CMakeLists.txt b/tests/auto/client/tabletv2/.prev_CMakeLists.txt deleted file mode 100644 index 96b32d24b..000000000 --- a/tests/auto/client/tabletv2/.prev_CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Generated from tabletv2.pro. - -##################################################################### -## tst_tabletv2 Test: -##################################################################### - -qt_internal_add_test(tst_tabletv2 - SOURCES - ../shared/corecompositor.cpp ../shared/corecompositor.h - ../shared/coreprotocol.cpp ../shared/coreprotocol.h - ../shared/datadevice.cpp ../shared/datadevice.h - ../shared/mockcompositor.cpp ../shared/mockcompositor.h - ../shared/textinput.cpp ../shared/textinput.h - ../shared/xdgoutputv1.cpp ../shared/xdgoutputv1.h - ../shared/xdgshell.cpp ../shared/xdgshell.h - tst_tabletv2.cpp - INCLUDE_DIRECTORIES - ../shared - PUBLIC_LIBRARIES - Qt::Gui - Qt::OpenGL - Qt::WaylandClientPrivate - Wayland::Server -) - -qt6_generate_wayland_protocol_server_sources(tst_tabletv2 - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/3rdparty/protocol/tablet-unstable-v2.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/text-input-unstable-v2.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/wayland.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/xdg-output-unstable-v1.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/xdg-shell.xml -) diff --git a/tests/auto/client/tabletv2/CMakeLists.txt b/tests/auto/client/tabletv2/CMakeLists.txt index 6d7507260..1400a511a 100644 --- a/tests/auto/client/tabletv2/CMakeLists.txt +++ b/tests/auto/client/tabletv2/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + # Generated from tabletv2.pro. ##################################################################### @@ -6,29 +9,7 @@ qt_internal_add_test(tst_tabletv2 SOURCES - ../shared/corecompositor.cpp ../shared/corecompositor.h - ../shared/coreprotocol.cpp ../shared/coreprotocol.h - ../shared/datadevice.cpp ../shared/datadevice.h - ../shared/mockcompositor.cpp ../shared/mockcompositor.h - ../shared/textinput.cpp ../shared/textinput.h - ../shared/xdgoutputv1.cpp ../shared/xdgoutputv1.h - ../shared/xdgshell.cpp ../shared/xdgshell.h tst_tabletv2.cpp - INCLUDE_DIRECTORIES - ../shared - PUBLIC_LIBRARIES - Qt::Gui - Qt::OpenGL - Qt::WaylandClientPrivate - Wayland::Server - Threads::Threads # special case -) - -qt6_generate_wayland_protocol_server_sources(tst_tabletv2 - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/3rdparty/protocol/tablet-unstable-v2.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/text-input-unstable-v2.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/wayland.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/xdg-output-unstable-v1.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../shared/../../../../src/3rdparty/protocol/xdg-shell.xml + LIBRARIES + SharedClientTest ) diff --git a/tests/auto/client/tabletv2/tabletv2.pro b/tests/auto/client/tabletv2/tabletv2.pro deleted file mode 100644 index 9dc9636e9..000000000 --- a/tests/auto/client/tabletv2/tabletv2.pro +++ /dev/null @@ -1,7 +0,0 @@ -include (../shared/shared.pri) - -WAYLANDSERVERSOURCES += \ - $$PWD/../../../../src/3rdparty/protocol/tablet-unstable-v2.xml - -TARGET = tst_tabletv2 -SOURCES += tst_tabletv2.cpp diff --git a/tests/auto/client/tabletv2/tst_tabletv2.cpp b/tests/auto/client/tabletv2/tst_tabletv2.cpp index 3e68e5d1e..85df099f9 100644 --- a/tests/auto/client/tabletv2/tst_tabletv2.cpp +++ b/tests/auto/client/tabletv2/tst_tabletv2.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite 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) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "mockcompositor.h" @@ -216,7 +191,7 @@ public: QList<TabletPadV2 *> m_padsWaitingForDestroy; protected: - void zwp_tablet_seat_v2_bind_resource(Resource *resource) + void zwp_tablet_seat_v2_bind_resource(Resource *resource) override { for (auto *tablet : m_tablets) sendTabletAdded(resource, tablet); @@ -726,12 +701,12 @@ void tst_tabletv2::pointerType() void tst_tabletv2::hardwareSerial() { ProximityFilter filter; - const qint64 uid = 0xbaba15dead15f00d; + const QPointingDeviceUniqueId uid = QPointingDeviceUniqueId::fromNumericId(0xbaba15dead15f00d); QCOMPOSITOR_TRY_VERIFY(tabletSeat()); exec([&] { tabletSeat()->addTablet(); - tabletSeat()->addTool(ToolType::type_pen, uid); + tabletSeat()->addTool(ToolType::type_pen, uid.numericId()); }); TabletWindow window; @@ -751,11 +726,11 @@ void tst_tabletv2::hardwareSerial() QTRY_COMPARE(filter.numEvents(), 1); QTabletEvent *event = filter.popEvent(); - QCOMPARE(event->uniqueId(), uid); + QCOMPARE(event->pointingDevice()->uniqueId(), uid); QTRY_VERIFY(window.numEvents()); event = window.popEvent(); - QCOMPARE(event->uniqueId(), uid); + QCOMPARE(event->pointingDevice()->uniqueId(), uid); exec([&] { tabletTool()->sendProximityOut(); @@ -764,7 +739,7 @@ void tst_tabletv2::hardwareSerial() QTRY_VERIFY(filter.numEvents()); event = filter.popEvent(); - QCOMPARE(event->uniqueId(), uid); + QCOMPARE(event->pointingDevice()->uniqueId(), uid); } // As defined in linux/input-event-codes.h |