Skip to content
Snippets Groups Projects

[WIP] [FS#1030] Add, use, and test DUNE_ASSERT_BOUNDS

Merged Elias Pipping requested to merge (removed):feature/FS1030-bounds-checking into master

Turning flyspray/FS#1030 (closed) into a merge request to make it easier to view the relevant changes.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 #ifndef DUNE_BOUNDSCHECKING_HH
2 #define DUNE_BOUNDSCHECKING_HH
3
4 #include <dune/common/exceptions.hh>
5
6 #ifdef DUNE_CHECK_BOUNDS
7 #define DUNE_ASSERT_BOUNDS(cond) \
  • Elias Pipping Added 2 commits:

    Added 2 commits:

    • f2f4e6e2 - Remove unnecessary includes
    • c6a4dbe5 - Allow DUNE_ASSERT_BOUNDS to be redefined
  • Author Developer

    The reason that this is still marked as WIP for is: The patchset as it currently stands, does four things:

    1. It adds an assertion macro
    2. It adds bounds checking to a few functions that currently don't have it
    3. It uses the assertion macro instead of custom bounds checking in a few functions
    4. It tests all of the above.

    What I'm unsure about is the third part: In a few places I'm changing exceptions of type (FMatrixError guarded by DUNE_FMatrix_WITH_CHECKING) into exceptions of type (RangeError guarded by DUNE_CHECK_BOUNDS), e.g. when FieldMatrix::mv checks the dimensions of its arguments. I'm not sure if that's acceptable or even an improvement -- again, the question is if a one-size-fits-all single-argument macro suffices.

  • Elias Pipping Added 1 commit:

    Added 1 commit:

    • 5b618064 - Do not guard DUNE_UNUSED_PARAMETER
  • Elias Pipping mentioned in merge request !17 (merged)

    mentioned in merge request !17 (merged)

  • Elias Pipping Status changed to closed

    Status changed to closed

  • Please register or sign in to reply
    Loading