summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-01-17 09:45:45 -0800
committerThiago Macieira <thiago.macieira@intel.com>2022-01-19 20:57:17 -0800
commit541253fcd601022870ab3a55ccb9fd52e4e1cc29 (patch)
treead0d862d5c56afd1e4a15f04b91ec7bdc140ed74 /tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
parent26f02d0bb727a81006a4a24e104f56a47affca15 (diff)
tst_QMetaType: remove the IsInitialized check
All primitive types are initialized and have been since at least commit 33cd680ddbaccf6139e215d851a39e657ae36394 ("New QMetaType representation"). Change-Id: I0e5f6bec596a4a78bd3bfffd16cb1fe22dc5c8f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp')
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 8c14278e1d..cfd023f439 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -741,12 +741,11 @@ static void testCreateHelper()
QMetaType info(ID);
void *actual1 = QMetaType::create(ID);
void *actual2 = info.create();
- if (DefaultValueTraits<ID>::IsInitialized) {
- Type *expected = DefaultValueFactory<ID>::create();
- QCOMPARE(*static_cast<Type *>(actual1), *expected);
- QCOMPARE(*static_cast<Type *>(actual2), *expected);
- delete expected;
- }
+ Type *expected = DefaultValueFactory<ID>::create();
+ QCOMPARE(*static_cast<Type *>(actual1), *expected);
+ QCOMPARE(*static_cast<Type *>(actual2), *expected);
+ delete expected;
+
QMetaType::destroy(ID, actual1);
info.destroy(actual2);
}
@@ -755,9 +754,6 @@ template<>
void testCreateHelper<QMetaType::Void>()
{
void *actual = QMetaType::create(QMetaType::Void);
- if (DefaultValueTraits<QMetaType::Void>::IsInitialized) {
- QVERIFY(DefaultValueFactory<QMetaType::Void>::create());
- }
QMetaType::destroy(QMetaType::Void, actual);
}
@@ -1138,12 +1134,10 @@ static void testConstructHelper()
void *actual2 = info.construct(storage2, /*copy=*/0);
QCOMPARE(actual1, storage1);
QCOMPARE(actual2, storage2);
- if (DefaultValueTraits<ID>::IsInitialized) {
- Type *expected = DefaultValueFactory<ID>::create();
- QCOMPARE(*static_cast<Type *>(actual1), *expected);
- QCOMPARE(*static_cast<Type *>(actual2), *expected);
- delete expected;
- }
+ Type *expected = DefaultValueFactory<ID>::create();
+ QCOMPARE(*static_cast<Type *>(actual1), *expected);
+ QCOMPARE(*static_cast<Type *>(actual2), *expected);
+ delete expected;
QMetaType::destruct(ID, actual1);
qFreeAligned(storage1);
info.destruct(actual2);
@@ -1163,9 +1157,6 @@ void testConstructHelper<QMetaType::Void>()
void *storage = 0;
void *actual = QMetaType::construct(QMetaType::Void, storage, /*copy=*/0);
QCOMPARE(actual, storage);
- if (DefaultValueTraits<QMetaType::Void>::IsInitialized) {
- QVERIFY(DefaultValueFactory<QMetaType::Void>::create());
- }
QMetaType::destruct(QMetaType::Void, actual);
qFreeAligned(storage);