diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-15 13:26:16 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-07-28 11:50:16 -0700 |
commit | 0f76e55bc440a70f5d9530a192c9ce6334a8f069 (patch) | |
tree | 8234800129e0eb16d41c89bbcc0db87cd4aa5bf9 /tests/auto/corelib/global | |
parent | a1c34d8bd09bfc6e80dcb06c7900d40c2d32518c (diff) |
QMetaObject: rewrite invokeMethod()
Use the QMetaMethodPrivate::invokeImpl() function we added in the last
commit, without recreating the method signature. Instead, only do a
comparison on the method name and allow invokeImpl() to decide whether
this method can be called with the given arguments. This will allow
invokeImpl() to have more flexibility in deciding if the arguments match,
using the stored metatype information.
Change-Id: I36b24183fbd041179f2ffffd17021a86484bfab6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/global')
-rw-r--r-- | tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 5de7830113..df0cb5ae77 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -727,9 +727,19 @@ void tst_qmessagehandler::qMessagePattern_data() QSKIP("These test cases don't work with static Qt builds"); #else #ifndef QT_NO_DEBUG - QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>() - // MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro - << "[MyClass::myFunction|MyClass::mySlot1|?" BACKTRACE_HELPER_NAME "?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34"); + QList<QByteArray> expectedBacktrace = { + // MyClass::qt_static_metacall is explicitly marked as hidden in the + // Q_OBJECT macro hence the ?helper? frame + "[MyClass::myFunction|MyClass::mySlot1|?" BACKTRACE_HELPER_NAME "?|", + + // QMetaObject::invokeMethod calls internal function + // (QMetaMethodPrivate::invokeImpl, at the tims of this writing), which + // will usually show only as ?libQt6Core.so? or equivalent, so we skip + + // end of backtrace, actual message + "|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34" + }; + QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << expectedBacktrace; #endif QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>() |