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.

Pick-to: 6.2
Change-Id: Ia188384b37c9c078e78d09670bd955a69d10c7de
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2021-06-15 11:30:15 +02:00
parent e36b5ce4df
commit 538d81bc69
1 changed files with 9 additions and 2 deletions

View File

@ -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();