[autotests] Fix failing TestBuiltInEffectLoader
AbandonedPublic

Authored by zzag on Jun 9 2018, 9:31 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

Effects like Mouse Mark and Track Mouse call methods on effects in their
destructors. It might happen that effects points to deallocated memory
(i.e. it's a dangling pointer) because Qt processes events after MockEffectsHandler
has been destroyed.

Test Plan

All tests in TestBuiltInEffectLoader are passing.

Diff Detail

Repository
R108 KWin
Branch
fix-builtin-effectloader-test
Lint
No Linters Available
Unit
No Unit Test Coverage
zzag created this revision.Jun 9 2018, 9:31 PM
Restricted Application added a project: KWin. · View Herald TranscriptJun 9 2018, 9:31 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jun 9 2018, 9:31 PM
zzag updated this revision to Diff 35907.Jun 9 2018, 9:40 PM

Fix also TestBuiltInEffectLoader::testLoadBuiltInEffect

zzag edited the test plan for this revision. (Show Details)Jun 9 2018, 9:52 PM
zzag abandoned this revision.Jun 9 2018, 10:10 PM

Ugly solution, it doesn't work if some QVERIFY or QCOMPARE fails.

zzag added a comment.Jun 9 2018, 10:52 PM

Same with TestScriptedEffectLoader and TestPluginEffectLoader. Effects outlive MockEffectsHandler.

Ugly solution, it doesn't work if some QVERIFY or QCOMPARE fails.

That's not really a problem. If a test fails, running the rest isn't too relevant. It's no worse than a test hitting an assert.

I've made an alternative, but I'd be more than happy to ship this.