tst_qqmlpropertycache: Adjust to modified name mangling from moc

b020bff6e9a2e45760bab61bdb84efc078c45f7f in qtbase changed the name
mangling that moc uses; normal code shouldn't care about this, but
tst_qqmlproperycache peeks into the internals, so we need to adjust it.

Change-Id: I16d4ee28b208d0e720f16bc92bfd7623842d9375
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fabian Kosmale 2024-09-23 09:51:52 +02:00
parent 150d4abdd9
commit cba7ec129b
1 changed files with 8 additions and 6 deletions

View File

@ -581,10 +581,12 @@ constexpr size_t sizeofOffsetsAndSizes(const T &)
return SizeofOffsetsAndSizes_helper<T>::value;
}
#define TEST_CLASS(Class) \
// NOTE: ScopeCounter might change new metaobjects are added
// check the moc file and adjust as necessary if tests fails to compile
#define TEST_CLASS(Class, ScopeCounter) \
QTest::newRow(#Class) \
<< &Class::staticMetaObject << ARRAY_SIZE(qt_meta_data_CLASS##Class##ENDCLASS) \
<< int(sizeofOffsetsAndSizes(qt_meta_stringdata_CLASS##Class##ENDCLASS) / (sizeof(uint) * 2))
<< &Class::staticMetaObject << ARRAY_SIZE(qt_meta_data_ZN##ScopeCounter##Class##E) \
<< int(sizeofOffsetsAndSizes(qt_meta_stringdata_ZN##ScopeCounter##Class##E) / (sizeof(uint) * 2))
Q_DECLARE_METATYPE(const QMetaObject*);
@ -594,9 +596,9 @@ void tst_qqmlpropertycache::metaObjectSize_data()
QTest::addColumn<int>("expectedFieldCount");
QTest::addColumn<int>("expectedStringCount");
TEST_CLASS(TestClass);
TEST_CLASS(TestClassWithParameters);
TEST_CLASS(TestClassWithClassInfo);
TEST_CLASS(TestClass, 9);
TEST_CLASS(TestClassWithParameters, 23);
TEST_CLASS(TestClassWithClassInfo, 22);
}
void tst_qqmlpropertycache::metaObjectSize()