Merge lp:~alan-griffiths/mir/improved-Rectangles into lp:mir
| Status: | Merged |
|---|---|
| Merged at revision: | 2255 |
| Proposed branch: | lp:~alan-griffiths/mir/improved-Rectangles |
| Merge into: | lp:mir |
| Diff against target: |
406 lines (+122/-72) 8 files modified
common-ABI-sha1sums (+1/-1) examples/server_example_window_management.cpp (+5/-10) include/common/mir/geometry/rectangles.h (+4/-4) platform-ABI-sha1sums (+1/-1) server-ABI-sha1sums (+1/-1) src/common/geometry/rectangles.cpp (+7/-1) src/common/symbols.map (+1/-0) tests/unit-tests/geometry/test-rectangles.cpp (+102/-54) |
| To merge this branch: | bzr merge lp:~alan-griffiths/mir/improved-Rectangles |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Needs Fixing on 2015-01-22 | |
| Kevin DuBois (community) | Approve on 2015-01-22 | ||
| Alexandros Frantzis (community) | Approve on 2015-01-22 | ||
| Daniel van Vugt | Needs Fixing on 2015-01-22 | ||
| Alberto Aguirre | 2015-01-21 | Approve on 2015-01-21 | |
|
Review via email:
|
|||
Commit Message
geometry: add a remove() method to the Rectangles class
Description of the Change
geometry: add a remove() method to the Rectangles class
This provides better support for tracking e.g. the display rectangles
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2245
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Kevin DuBois (kdub) wrote : | # |
It is was somewhat unclear what remove does if you add multiple same-sized-
| Kevin DuBois (kdub) wrote : | # |
> It is was somewhat unclear what remove does if you add multiple same-sized-
*It is somewhat...
https:/
| Daniel van Vugt (vanvugt) wrote : | # |
This potentially makes us sensitive to the order in which tests are run, so should probably be undone:
173 +struct TestRectangles : Test
174 +{
175 + Rectangles rectangles;
202 - Rectangles rectangles;
203 -
...
| Daniel van Vugt (vanvugt) wrote : | # |
I think what Kevin is asking for is a: std::set<Rectangle>
| Daniel van Vugt (vanvugt) wrote : | # |
Hmm, why don't we just have a set<Rectangle> or unordered_
The required comparison operator for Rectangle to make it work would be simple to add.
| Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
> It is somewhat unclear what remove does if you add multiple same-sized-
> maybe a test that checks that all rectangles of the same size are removed
It would be good to have a test and comment for this.
> This potentially makes us sensitive to the order in which tests are run,
> so should probably be undone:
>
> 173 +struct TestRectangles : Test
> 174 +{
> 175 + Rectangles rectangles;
A new fixture instance is created for each test case.
> Hmm, why don't we just have a set<Rectangle> or unordered_
Rectangles is designed to hold multiple same-sized-
| Alan Griffiths (alan-griffiths) wrote : | # |
> Looks good.
>
> > It is somewhat unclear what remove does if you add multiple same-sized-
> rectangles,
> > maybe a test that checks that all rectangles of the same size are removed
>
> It would be good to have a test and comment for this.
Done
| Alan Griffiths (alan-griffiths) wrote : | # |
> This potentially makes us sensitive to the order in which tests are run, so
> should probably be undone:
>
> 173 +struct TestRectangles : Test
> 174 +{
> 175 + Rectangles rectangles;
>
> 202 - Rectangles rectangles;
> 203 -
> ...
Oh no it doesn't.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
| Kevin DuBois (kdub) wrote : | # |
The intended behavior is clearer with the tests, so lgtm!
| Alan Griffiths (alan-griffiths) wrote : | # |
[ 71%] Building CXX object tests/integrati
FATAL: Unable to delete script file /tmp/hudson7970
hudson.
reapproving
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2248
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
| Daniel van Vugt (vanvugt) wrote : | # |
I meant this increases the future risk of us becoming sensitive to the order of test case execution. Even if the current test cases guard against that, it's more defensive to make it impossible for future maintainers to make such a mistake. And would provide higher cohesion of tests too...
192 +struct TestRectangles : Test
193 +{
194 + Rectangles rectangles;
So TEST_F becomes TEST again.
| Alan Griffiths (alan-griffiths) wrote : | # |
> I meant this increases the future risk of us becoming sensitive to the order
> of test case execution. Even if the current test cases guard against that,
> it's more defensive to make it impossible for future maintainers to make such
> a mistake. And would provide higher cohesion of tests too...
>
> 192 +struct TestRectangles : Test
> 193 +{
> 194 + Rectangles rectangles;
>
> So TEST_F becomes TEST again.
Daniel, I really don't understand your concern. Are you misreading
> 194 + Rectangles rectangles;
as this?
Moving rectangles from function scope to instance scope doesn't share it between different instances.

LGTM