Move non-optional ModelSpy dependency to ctor
ClosedPublic

Authored by dkurz on Oct 31 2018, 8:59 PM.

Details

Summary

A ModelSpy cannot work without a model, and there is no point
re-setting it, so it should be set in the ctor only.

Diff Detail

Repository
R165 Akonadi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dkurz created this revision.Oct 31 2018, 8:59 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptOct 31 2018, 8:59 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dkurz requested review of this revision.Oct 31 2018, 8:59 PM
dvratil accepted this revision.Nov 1 2018, 12:36 PM
dvratil added a subscriber: dvratil.

I would say that the ModelSpy should even be created on the stack because the way it is now it leaks from one test run to another (this is only destroyed after all tests methods are executed).

Would you mind changing that, since you are touching the tests?

This revision is now accepted and ready to land.Nov 1 2018, 12:36 PM
dkurz added a comment.Nov 1 2018, 12:45 PM

Would you mind changing that, since you are touching the tests?

I plan to, but when I first tried, all the tests blew up, big time. Moving all those objects to the stack was one of the things I had done in my first try.

This revision was automatically updated to reflect the committed changes.