diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2021-06-15 11:30:15 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-15 15:44:56 +0000 |
commit | d183e6b2f04f8fc4fdb35b8753ecf35e9b9e33d5 (patch) | |
tree | e403abe2bff956c5dd7092b03fba6997228dfaaf | |
parent | 7c70326dcd79dbe0a2a325d63b2e87698491c761 (diff) |
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 <paul.tvete@qt.io>
(cherry picked from commit 538d81bc69c4fb6eed17bc23c992bcee0c5fa393)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp | 11 |
1 files 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(); |