summaryrefslogtreecommitdiffstats
path: root/tests/auto/core
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-06-18 03:03:52 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-06-18 03:03:52 +0200
commit186b082e965a965bd5ded451e5ab533b7757c821 (patch)
treed558e1a5e2550677ac3800162ceed8b448b0f1a6 /tests/auto/core
parentc61479f9a6be1ee239aef48babc854bbebec4b31 (diff)
parent5c61a32369b003bae6ed045da230db8d8dd0f82d (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'tests/auto/core')
-rw-r--r--tests/auto/core/qentity/tst_qentity.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/core/qentity/tst_qentity.cpp b/tests/auto/core/qentity/tst_qentity.cpp
index 04f695953..7770a2632 100644
--- a/tests/auto/core/qentity/tst_qentity.cpp
+++ b/tests/auto/core/qentity/tst_qentity.cpp
@@ -688,10 +688,19 @@ void tst_Entity::checkComponentBookkeeping()
QCOMPARE(rootEntity->components().size(), 1);
// WHEN
- rootEntity.reset();
+ int sigCount = 0;
+ QObject *sigSender = comp.data();
+ connect(comp.data(), &QComponent::removedFromEntity, [&sigCount, sigSender](QEntity *) {
+ QComponent *c = qobject_cast<QComponent *>(sigSender);
+ if (sigSender && c)
+ sigCount++; // test the sender is still a QComponent when signal is emitted
+ });
+
comp.reset();
+ rootEntity.reset();
// THEN (Should not crash when the comp is destroyed (tests for failed removal of destruction helper)
+ QCOMPARE(sigCount, 1);
}
}