Merge lp:~raof/mir/optional-check-precondition into lp:mir
| Status: | Merged |
|---|---|
| Approved by: | Alberto Aguirre on 2015-06-09 |
| Approved revision: | 2608 |
| Merged at revision: | 2644 |
| Proposed branch: | lp:~raof/mir/optional-check-precondition |
| Merge into: | lp:mir |
| Diff against target: |
112 lines (+16/-8) 6 files modified
include/common/mir/optional_value.h (+10/-1) src/client/mir_surface.cpp (+1/-1) src/common/CMakeLists.txt (+2/-0) src/common/symbols.map (+3/-1) src/platform/CMakeLists.txt (+0/-2) src/platform/symbols.map (+0/-3) |
| To merge this branch: | bzr merge lp:~raof/mir/optional-check-precondition |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Approve on 2015-06-09 | |
| Alberto Aguirre | Approve on 2015-06-09 | ||
| Alan Griffiths | 2015-06-01 | Needs Fixing on 2015-06-03 | |
| Kevin DuBois (community) | Approve on 2015-06-02 | ||
|
Review via email:
|
|||
Commit Message
Make optional_
Namely, that a value has been set.
Then fix the place in the code where we access an unset optional_value.
Description of the Change
Make optional_
Namely, that a value has been set.
This then breaks all the acceptance tests, because the MirSurface constructor accesses the value of an unset optional_value, so fix that.
| Alan Griffiths (alan-griffiths) wrote : | # |
*Needs Discussion*
I'd prefer a mir::fatal_error:
20 + if (!is_set())
21 + {
22 + BOOST_THROW_
23 + }
As you say, it is a *precondition* failure and exceptions are for *postcondition* failures.
8 +#include <boost/
This pulls quite a lot into what was previously a lightweight include.
| Chris Halse Rogers (raof) wrote : | # |
FWIW, std::experiment
I'd also be happy with mir::fatal_error; optional<
The throw_exception.hpp include is indeed pretty big, and I don't think any of our other public headers include it. I'm happy to just throw, if it's deemed excessive.
| Kevin DuBois (kdub) wrote : | # |
I'd be more in favor of throwing like std::experiment
| Kevin DuBois (kdub) wrote : | # |
I guess approve, although I also would prefer not pulling in boost and just throwing a std exception type.
| Alan Griffiths (alan-griffiths) wrote : | # |
I'm more concerned that we should detect and correct invalid logic during testing than have it accidentally hidden a catch clause intended for a different case. So I'd prefer being able to abort. fatal_error gives that option:
/**
* fatal_error() is strictly for "this should never happen" situations that
* you cannot recover from. By default it points at fatal_error_
* Note the reason parameter is a simple char* so its value is clearly visible
* in stack trace output.
* \param [in] reason A printf-style format string.
*/
...
--on-
| Alberto Aguirre (albaguirre) wrote : | # |
>I'm more concerned that we should detect and correct invalid logic during testing
+1 I also prefer fatal_error for this case.
| Kevin DuBois (kdub) wrote : | # |
> I'm more concerned that we should detect and correct invalid logic during
> testing than have it accidentally hidden a catch clause intended for a
> different case. So I'd prefer being able to abort. fatal_error gives that
> option:
Ah, had forgotten about the option to have a nicer fatal error... with that fatal_error makes more sense to me too
- 2606. By Chris Halse Rogers on 2015-06-04
-
Move mir::fatal_error to mircommon
- 2607. By Chris Halse Rogers on 2015-06-04
-
Use mir::fatal_error rather than throwing an exception for optional_value precondition violations
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2607
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Alberto Aguirre (albaguirre) wrote : | # |
+# Symbols moved from libmirplatform; can be folded into a MIR_COMMON stanza
66 +# at next mirplatform ABI break.
67 +MIRPLATFORM_7 {
68 + global:
69 + extern "C++" {
70 + mir::fatal_error*;
71 + mir::fatal_
72 + mir::fatal_
73 + };
74 +};
We already broke MIRPLATFORM ABI :)
- 2608. By Chris Halse Rogers on 2015-06-09
-
Merge trunk
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2608
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2608
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://
| Alberto Aguirre (albaguirre) wrote : | # |
Alan's Needs fixing has been addressed. TA'ing.

PASSED: Continuous integration, rev:2605 jenkins. qa.ubuntu. com/job/ mir-ci/ 3956/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/2641 jenkins. qa.ubuntu. com/job/ mir-clang- wily-amd64- build/152 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/2589 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 112 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 112/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 2589 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 2589/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/5439 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 20856
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: s-jenkins. ubuntu- ci:8080/ job/mir- ci/3956/ rebuild
http://