diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-15 03:02:52 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-15 03:02:52 +0200 |
commit | e0548a3d24bda6ddee02c38d3abee285ddf33a6d (patch) | |
tree | 06c9d30eab9d00657a8bee8510774433c5cb0c25 /tests/auto/core | |
parent | 666a645d1edc98dfea92fdaf7eaeed10c86dbc56 (diff) | |
parent | 50d41e6f0e7dd97f3d4cbd68423d59cacd4b7700 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I903f92a7b910eee165a2dd708a2d5fb25192ab14
Diffstat (limited to 'tests/auto/core')
-rw-r--r-- | tests/auto/core/qentity/tst_qentity.cpp | 11 |
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); } } |