Merge lp:~3v1n0/unity/testing-friend into lp:unity
Status: | Rejected |
---|---|
Rejected by: | Andrea Azzarone |
Proposed branch: | lp:~3v1n0/unity/testing-friend |
Merge into: | lp:unity |
Prerequisite: | lp:~3v1n0/unity/launcher-controller-ensure-new |
Diff against target: |
569 lines (+275/-76) 7 files modified
launcher/EdgeBarrierController.cpp (+1/-41) launcher/EdgeBarrierController.h (+3/-3) launcher/EdgeBarrierControllerPrivate.h (+68/-0) launcher/LauncherController.h (+2/-2) tests/test_edge_barrier_controller.cpp (+34/-28) tests/test_launcher_controller.cpp (+12/-2) unity-shared/TestingFriend.h (+155/-0) |
To merge this branch: | bzr merge lp:~3v1n0/unity/testing-friend |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone (community) | Disapprove | ||
Brandon Schaefer (community) | Needs Fixing | ||
Francis Ginther | Abstain | ||
jenkins (community) | continuous-integration | Needs Fixing | |
Review via email: mp+116783@code.launchpad.net |
Commit message
TestingFriend: added testing friend, a tool that will (hopefully) help you in testing!
Description of the change
Added the unity::
Basically it's only needed that the class(es) you're testing is friend of unity::
I've added some macros that allow this definition easier. This is needed since in C++ the friendship is not transitive.
I know that the same could have been achieved just by adding a different friend class for each class that is then implemented as inheriting from ::testing::Test (as done in lp:~3v1n0/unity/launcher-controller-ensure-new for LauncherControl
1) it would have allowed to access to all members from the tests, without any explicit control on it
2) it would have not allowed to test interactions between classes without defining friends around
Unmerged revisions
- 2558. By Marco Trevisan (Treviño)
-
Merging with lp:~3v1n0/unity/launcher-controller-ensure-new (and trunk)
- 2557. By Marco Trevisan (Treviño)
-
test_edge_
barrier_ controller: use tests::Friend - 2556. By Marco Trevisan (Treviño)
-
EdgeBarrierCont
roller: move the definition of ::Impl in EdgeBarrierCont rollerPrivate For testing purposes...
- 2555. By Marco Trevisan (Treviño)
-
LauncherController: use unity::
tests:: Friend to access to pimpl! - 2554. By Marco Trevisan (Treviño)
-
TestingFriend: added testing friend, a tool that will help you in testing!
Don't you have to make sure that the unit::tests::Friend class is in an anonymous namespace in the test source file to make sure you don't get linking errors?