QObject: add another couple of tests for broken connect()

Connecting to a non-signal should fail, but apparently it doesn't on
Windows+MSVC under certain conditions.

Task-number: QTBUG-101761
Change-Id: I3e014660e4e5b287242e32307f677bb22ab10a39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2022-03-16 02:42:53 +01:00
parent 2f894293ae
commit 979ee48ca1
1 changed files with 11 additions and 0 deletions

View File

@ -4533,6 +4533,17 @@ void tst_QObject::pointerConnect()
con = connect(&r1, &ReceiverObject::slot4 , &s, &SenderObject::signal4);
QVERIFY(!con);
QVERIFY(!QObject::disconnect(con));
//connect an arbitrary PMF to a slot
QTest::ignoreMessage(QtWarningMsg, "QObject::connect: signal not found in ReceiverObject");
con = connect(&r1, &ReceiverObject::reset, &r1, &ReceiverObject::slot1);
QVERIFY(!con);
QVERIFY(!QObject::disconnect(con));
QTest::ignoreMessage(QtWarningMsg, "QObject::connect: signal not found in ReceiverObject");
con = connect(&r1, &ReceiverObject::reset, &r1, [](){});
QVERIFY(!con);
QVERIFY(!QObject::disconnect(con));
}
void tst_QObject::pointerDisconnect()