From a1c1dda4186e3ebc5dddcb2af926ab724dcffc5f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 3 Jun 2025 17:12:30 -0300 Subject: [PATCH] Wayland tests: use initTestCase() instead of init() to set env Once is fine. We don't need to set the environment before each test function. Change-Id: Id27938950c196d6d3397fffd2fbf1a66fe7504f9 Reviewed-by: Liang Qi Reviewed-by: David Redondo (cherry picked from commit 4e57583f33fed081442526dff6473ce00c85e0be) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/wayland/cursor/tst_cursor.cpp | 4 ++-- tests/auto/wayland/scaling/tst_scaling.cpp | 4 ++-- tests/auto/wayland/xdgshell/tst_xdgshell.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/wayland/cursor/tst_cursor.cpp b/tests/auto/wayland/cursor/tst_cursor.cpp index 303802667a9..e151f2b8629 100644 --- a/tests/auto/wayland/cursor/tst_cursor.cpp +++ b/tests/auto/wayland/cursor/tst_cursor.cpp @@ -18,7 +18,7 @@ public: tst_cursor(); CursorShapeDevice* cursorShape(); private slots: - void init(); + void initTestCase(); void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void setCursor(); void overrideCursor(); @@ -40,7 +40,7 @@ CursorShapeDevice* tst_cursor::cursorShape() return manager->m_cursorDevices[0]; } -void tst_cursor::init() +void tst_cursor::initTestCase() { setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1); } diff --git a/tests/auto/wayland/scaling/tst_scaling.cpp b/tests/auto/wayland/scaling/tst_scaling.cpp index de36d34aa1d..b0ba7931eed 100644 --- a/tests/auto/wayland/scaling/tst_scaling.cpp +++ b/tests/auto/wayland/scaling/tst_scaling.cpp @@ -13,7 +13,7 @@ class tst_scaling : public QObject, private DefaultCompositor { Q_OBJECT private slots: - void init(); + void initTestCase(); void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void scaledWindow(); void roundingPolicy_data(); @@ -21,7 +21,7 @@ private slots: }; -void tst_scaling::init() +void tst_scaling::initTestCase() { setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1); } diff --git a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp index 3a7e001e1d9..d41829c31dc 100644 --- a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp @@ -14,7 +14,7 @@ class tst_xdgshell : public QObject, private DefaultCompositor { Q_OBJECT private slots: - void init(); + void initTestCase(); void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void showMinimized(); void basicConfigure(); @@ -40,7 +40,7 @@ private slots: void modalityWithoutTransientParent(); }; -void tst_xdgshell::init() +void tst_xdgshell::initTestCase() { setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1); }