|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Bounded_Cycle_Index when an allocation fails: building it throws std::bad_alloc whatever allocation fails, an index built apart replaces another without allocating, an assignment that fails leaves the index as it was, and neither the queries nor the moves allocate. More...
#include <gtest/gtest.h>#include "allocation_failure.H"#include <new>#include <utility>#include <vector>#include <Bounded_Cycle_Index.H>#include <tpl_graph.H>Go to the source code of this file.
Classes | |
| struct | BoundedCycleIndexAllocation |
Functions | |
| TEST_F (BoundedCycleIndexAllocation, BuildingThrowsBadAllocWhateverAllocationFails) | |
| TEST_F (BoundedCycleIndexAllocation, AnIndexBuiltApartReplacesAnotherWithoutAllocating) | |
| TEST_F (BoundedCycleIndexAllocation, TheQueriesDoNotAllocate) | |
| TEST_F (BoundedCycleIndexAllocation, AnAssignmentThatFailsLeavesTheIndexAsItWas) | |
| TEST_F (BoundedCycleIndexAllocation, MovingAnIndexDoesNotAllocate) | |
Bounded_Cycle_Index when an allocation fails: building it throws std::bad_alloc whatever allocation fails, an index built apart replaces another without allocating, an assignment that fails leaves the index as it was, and neither the queries nor the moves allocate.
This program replaces the global operator new, so that a test can make an allocation fail and count those that are asked for.
Definition in file bounded_cycle_index_allocation_test.cc.
| TEST_F | ( | BoundedCycleIndexAllocation | , |
| AnAssignmentThatFailsLeavesTheIndexAsItWas | |||
| ) |
Definition at line 244 of file bounded_cycle_index_allocation_test.cc.
| TEST_F | ( | BoundedCycleIndexAllocation | , |
| AnIndexBuiltApartReplacesAnotherWithoutAllocating | |||
| ) |
Definition at line 169 of file bounded_cycle_index_allocation_test.cc.
References Aleph::next().
| TEST_F | ( | BoundedCycleIndexAllocation | , |
| BuildingThrowsBadAllocWhateverAllocationFails | |||
| ) |
Definition at line 130 of file bounded_cycle_index_allocation_test.cc.
References k.
| TEST_F | ( | BoundedCycleIndexAllocation | , |
| MovingAnIndexDoesNotAllocate | |||
| ) |
Definition at line 290 of file bounded_cycle_index_allocation_test.cc.
References h.
| TEST_F | ( | BoundedCycleIndexAllocation | , |
| TheQueriesDoNotAllocate | |||
| ) |
Definition at line 209 of file bounded_cycle_index_allocation_test.cc.
References arcs, Aleph::count(), and Aleph::sum().