-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handling of internal failure modes and fix section bug #81
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 92.61% 93.29% +0.68%
==========================================
Files 2 2
Lines 1272 1237 -35
==========================================
- Hits 1178 1154 -24
+ Misses 94 83 -11
Continue to review full report in Codecov by Sentry.
|
doc/coding_guidelines.md
Outdated
- Functions in `<algorithm>` ([except `std::stable_sort`, `std::stable_partition`, and `std::inplace_merge`](https://stackoverflow.com/a/46714875/1565581)). | ||
- Concepts and type traits. | ||
|
||
Any type or function not listed above *should* be assumed to use heap memory unless demonstrated otherwise. One way to monitor this is on Linux is to use [valgrind/massif](https://valgrind.org/docs/manual/ms-manual.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-One way to monitor this is on Linux is to use
+One way to monitor this on Linux is to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, thanks!
doc/coding_guidelines.md
Outdated
|
||
Therefore: | ||
- Place as much code as possible in the `*.cpp` files rather than in headers. | ||
- When not possible (templates, constexpr, etc.), consider if you can use a short and clear hand-written alternative instead. For example, `std::max(a, b)` requires `<algorithm>`, but can also be written as `a > b ? a : b`. Some of the simplest algorithms in `<algorithm>`, like `std::copy`, can also be written with an explicit loop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-and clear hand-written alternative instead
+and clear handwritten alternative instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more you know :) Thanks
This PR does the following:
snitch::small_function
to stronger invariants (always contains a function to call). This is technically a breaking change (the class lost itsempty()
member, and is no longer default-constructible), but this should not affect anyone using snitch as a testing framework.std::terminate
to a customizable assertion handler (terminates by default, but can be made to throw instead for testing).noexcept
to the whole code. This led to a minor but measurable performance degradation (on compilation time mostly).