Get rid off TestProjectController
ClosedPublic

Authored by kfunk on Dec 30 2015, 4:38 PM.

Details

Summary

A test in kdev-ruby fails, and the root problem is that
TestProjectController destroys some of the semantics of its
ProjectController base. ProjectController isn't able to delete projects
in such cases => leads to strange issues in the end.

Fix for good: Remove TestProjectController, and add a little more API to
IProject & IProjectController which we can access from unit tests.

Also leads to a cleaner implementation of
ProjectController::closeProject (no cast to Project* needed anymore).

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kfunk updated this revision to Diff 1673.Dec 30 2015, 4:38 PM
kfunk retitled this revision from to Get rid off TestProjectController.
kfunk updated this object.
kfunk edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptDec 30 2015, 4:38 PM
mwolff added a subscriber: mwolff.Dec 31 2015, 1:15 PM

I'd prefer if we find a way to fix the code to have the separation in tact while fixing the bug. is this really not possible?

interfaces/iprojectcontroller.h
156

b/c this is only used in testing environments we pushed this code into the test controller to separate the API and keep the public one as minimal as possible.

can't we keep this in the test controller?

kfunk added inline comments.Dec 31 2015, 2:58 PM
interfaces/iprojectcontroller.h
156

Yep, I noticed it should be possible by coupling TestController closer to ProjectController.

I'll recreate TestController, and move back addProject and takeProject. Rest is still useful in public interfaces; esp. IProject::close allows a cleaner implementation in ProjectController.

Will also revert some of the changes in the unit tests.

kfunk updated this revision to Diff 1774.Jan 7 2016, 7:25 PM

Address concerns

mwolff added a comment.Jan 8 2016, 4:27 PM

the diff is strangely formatted, i.e. I only see the diff to previous, not the diff to master. is that just me?

kfunk added a comment.Jan 8 2016, 4:37 PM

Problem is: Patch was rebased in-between, thus you see unrelated changes.

mwolff accepted this revision.Jan 8 2016, 8:39 PM
mwolff added a reviewer: mwolff.

yay

This revision is now accepted and ready to land.Jan 8 2016, 8:39 PM
This revision was automatically updated to reflect the committed changes.