|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Namespaces | |
| namespace | detail |
Functions | |
| Rectangle | union_of (const Rectangle &a, const Rectangle &b) |
| Computes the tight axis-aligned union of two rectangles. | |
| template<typename Snapshot > | |
| size_t | check_snapshot_node (const Snapshot &snap, const size_t idx, const size_t expected_depth) |
Recursively validates the structural invariants of a DebugSnapshot produced by RTree::debug_snapshot() or RStarTree::debug_snapshot(), reporting GTest failures on mismatch. | |
| void | expect_array_eq (const Array< size_t > &a, std::initializer_list< size_t > expected) |
| Assert that an Aleph::Array contains exactly the elements in an initializer_list. | |
| size_t Aleph::test_helpers::check_snapshot_node | ( | const Snapshot & | snap, |
| const size_t | idx, | ||
| const size_t | expected_depth | ||
| ) |
Recursively validates the structural invariants of a DebugSnapshot produced by RTree::debug_snapshot() or RStarTree::debug_snapshot(), reporting GTest failures on mismatch.
Checks, for the subtree rooted at idx: every node's recorded depth matches expected_depth (increasing by one per level), every leaf's stored bbox is the tight union of its entry_boxes, every internal node's bbox is the tight union of its children's bboxes, and every child index is in range. An out-of-range idx (including an empty snapshot) or a repeated node index (cycle) is reported as a test failure via GTest's non-fatal ADD_FAILURE/EXPECT_* macros instead of causing out-of-bounds access or unbounded recursion.
| snap | Snapshot to validate. |
| idx | Index into snap.nodes of the subtree root to check. |
| expected_depth | Depth expected for the node at idx. |
idx and the reachability of nodes are validated internally. | Never | throws (violations are reported via GTest assertions, not exceptions). |
snap.nodes.size() (each node is visited at most once thanks to the cycle guard). Not thread-safe: relies on GTest's current-test-scoped assertion state and must not be called concurrently on the same test. Definition at line 143 of file r_tree_debug_snapshot_test_helpers.H.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::test_helpers::detail::check_snapshot_node_impl().
|
inline |
Assert that an Aleph::Array contains exactly the elements in an initializer_list.
Performs equality checks between each element of the array and the corresponding element in the expected list.
| [in] | a | The Aleph::Array to check. |
| [in] | expected | Initializer list of expected values. |
Definition at line 52 of file test_helpers.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::Array< T >::size(), and value.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Computes the tight axis-aligned union of two rectangles.
| a | First rectangle. |
| b | Second rectangle. |
a and b. | Never | throws. |
Definition at line 52 of file r_tree_debug_snapshot_test_helpers.H.
References Aleph::Rectangle::get_xmax(), Aleph::Rectangle::get_xmin(), Aleph::Rectangle::get_ymax(), and Aleph::Rectangle::get_ymin().
Referenced by Aleph::test_helpers::detail::check_snapshot_node_impl().