tst_bench_qmetaobject: Fix test

The code has apparently been broken for quite a while, probably since
the change that made the QObject constructor invokable.

Fixes: QTBUG-91710
Pick-to: 6.0 6.1 5.15
Change-Id: I8b7e6c8a579913b3d0e2a364ffdbffe8d404c72b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Fabian Kosmale 2021-03-10 13:29:57 +01:00
parent 98e4652a96
commit ed3df88846

View File

@ -237,11 +237,12 @@ void tst_qmetaobject::unconnected()
{
LotsOfSignals *obj = new LotsOfSignals;
QFETCH(int, signal_index);
QVERIFY(obj->metaObject()->methodCount() == 73);
// 74: 70 signals in LotsOfSignals, 2 signals, 1 slot + 1 invokable in QObject
QCOMPARE(obj->metaObject()->methodCount(), 74);
void *v;
QBENCHMARK {
//+1 because QObject has one slot
QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, signal_index+1, &v);
// Add two because QObject has one slot and one invokable
QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, signal_index + 2, &v);
}
delete obj;
}