From d183e6b2f04f8fc4fdb35b8753ecf35e9b9e33d5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 15 Jun 2021 11:30:15 +0200 Subject: Make tst_qquickshadereffect::testConnection() more robust The test is there to verify that the sourceChanged property notifier gets a connection, but it also counted all other connections. Since b65159a5ea8db05165b2eaab8e180a12f30063e4 in qtbase the parentChanged, windowChanged and enabledChanged signals are also connected to something so this broke the test. Fix is to make the test explicitly look for the sourceChanged signal and ignore all others. Change-Id: Ia188384b37c9c078e78d09670bd955a69d10c7de Reviewed-by: Paul Olav Tvete (cherry picked from commit 538d81bc69c4fb6eed17bc23c992bcee0c5fa393) Reviewed-by: Qt Cherry-pick Bot --- .../auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp index 4115c27910..070eba32c0 100644 --- a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp +++ b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp @@ -56,8 +56,15 @@ public: int signalsConnected = 0; protected: - void connectNotify(const QMetaMethod &) override { ++signalsConnected; } - void disconnectNotify(const QMetaMethod &) override { --signalsConnected; } + void connectNotify(const QMetaMethod &s) override { + if (s.name() == "sourceChanged") + ++signalsConnected; + } + void disconnectNotify(const QMetaMethod &s) override + { + if (s.name() == "sourceChanged") + --signalsConnected; + } signals: void dummyChanged(); -- cgit v1.2.3