|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests of Dfs_Stack, the stack of frames of the searches that do not recurse, and of Dfs_Here, the variable that holds the frame of the node that a search visits. More...
#include <gtest/gtest.h>#include "allocation_failure.H"#include <new>#include <optional>#include <stdexcept>#include <string>#include <thread>#include <type_traits>#include <utility>#include <tpl_dfs_stack.H>Go to the source code of this file.
Functions | |
| TEST (DfsStack, PopsInTheReverseOrderOfThePushes) | |
| TEST (DfsStack, GrowingKeepsTheFrames) | |
| TEST_F (CountedFrames, ClearAndTheDestructorDestroyTheFrames) | |
| TEST_F (CountedFrames, AFrameThatThrowsLeavesTheStackAsItWas) | |
| TEST_F (CountedFrames, ACopyThatThrowsWhileGrowingLeavesTheStackAsItWas) | |
| TEST (DfsStack, AMoveThatThrowsWhileGrowingFreesTheNewRoom) | |
| TEST (DfsStack, TheCapacityIsThatOfTheRoom) | |
| TEST_F (CountedFrames, ReleaseDestroysTheFramesAndGivesTheRoomBack) | |
| TEST (DfsStack, MovesTakeTheFrames) | |
| TEST_F (DfsStackRoom, AStackOfTheSameThreadReusesTheRoom) | |
| TEST_F (DfsStackRoom, AStackOfAnotherThreadHasNoRoom) | |
| TEST_F (DfsStackRoom, ALargeRoomIsNotKept) | |
| TEST_F (DfsStackRoom, TheRoomTakenFromTheThreadGoesBackWhenTheStackGrows) | |
| TEST_F (DfsStackRoom, ARoomReleasedIsReused) | |
| TEST (DfsStack, TheThreadOfMainIsToldByItsId) | |
| TEST (DfsStack, TheRoomWithoutFramesIsPoisoned) | |
| TEST (DfsHere, ReplacesAFrameThatCannotBeAssigned) | |
| TEST (DfsHere, AssignsTheFramesThatCanBe) | |
Tests of Dfs_Stack, the stack of frames of the searches that do not recurse, and of Dfs_Here, the variable that holds the frame of the node that a search visits.
This program replaces the global operator new, so that a test can see that a stack reuses the room that another stack of its thread kept.
Definition in file dfs_stack_test.cc.
| TEST | ( | DfsHere | , |
| AssignsTheFramesThatCanBe | |||
| ) |
Definition at line 555 of file dfs_stack_test.cc.
References Aleph::dfs_frame(), Aleph::dfs_replace(), and value.
| TEST | ( | DfsHere | , |
| ReplacesAFrameThatCannotBeAssigned | |||
| ) |
Definition at line 520 of file dfs_stack_test.cc.
References Aleph::dfs_frame(), Aleph::dfs_replace(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::top(), and value.
| TEST | ( | DfsStack | , |
| AMoveThatThrowsWhileGrowingFreesTheNewRoom | |||
| ) |
Definition at line 225 of file dfs_stack_test.cc.
References Aleph::and, Aleph::next(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST | ( | DfsStack | , |
| GrowingKeepsTheFrames | |||
| ) |
Definition at line 147 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST | ( | DfsStack | , |
| MovesTakeTheFrames | |||
| ) |
Definition at line 288 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::is_empty(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST | ( | DfsStack | , |
| PopsInTheReverseOrderOfThePushes | |||
| ) |
Definition at line 127 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::is_empty(), Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST | ( | DfsStack | , |
| TheCapacityIsThatOfTheRoom | |||
| ) |
Definition at line 256 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::capacity(), Aleph::Dfs_Stack< T >::clear(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::size().
| TEST | ( | DfsStack | , |
| TheRoomWithoutFramesIsPoisoned | |||
| ) |
Definition at line 461 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::clear(), Aleph::next(), Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::top().
| TEST | ( | DfsStack | , |
| TheThreadOfMainIsToldByItsId | |||
| ) |
Definition at line 443 of file dfs_stack_test.cc.
References Aleph::dfs_stack_detail::in_main_thread().
| TEST_F | ( | CountedFrames | , |
| ACopyThatThrowsWhileGrowingLeavesTheStackAsItWas | |||
| ) |
Definition at line 191 of file dfs_stack_test.cc.
References Aleph::and, Aleph::next(), Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST_F | ( | CountedFrames | , |
| AFrameThatThrowsLeavesTheStackAsItWas | |||
| ) |
Definition at line 177 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST_F | ( | CountedFrames | , |
| ClearAndTheDestructorDestroyTheFrames | |||
| ) |
Definition at line 160 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::clear(), Aleph::Dfs_Stack< T >::is_empty(), and Aleph::Dfs_Stack< T >::push().
| TEST_F | ( | CountedFrames | , |
| ReleaseDestroysTheFramesAndGivesTheRoomBack | |||
| ) |
Definition at line 270 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::capacity(), Aleph::Dfs_Stack< T >::is_empty(), Aleph::Dfs_Stack< T >::push(), Aleph::Dfs_Stack< T >::release(), Aleph::Dfs_Stack< T >::size(), and Aleph::Dfs_Stack< T >::top().
| TEST_F | ( | DfsStackRoom | , |
| ALargeRoomIsNotKept | |||
| ) |
Definition at line 371 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::capacity(), and Aleph::Dfs_Stack< T >::push().
| TEST_F | ( | DfsStackRoom | , |
| ARoomReleasedIsReused | |||
| ) |
Definition at line 425 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::capacity(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::release().
| TEST_F | ( | DfsStackRoom | , |
| AStackOfAnotherThreadHasNoRoom | |||
| ) |
Definition at line 347 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::push().
| TEST_F | ( | DfsStackRoom | , |
| AStackOfTheSameThreadReusesTheRoom | |||
| ) |
Definition at line 335 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::push().
| TEST_F | ( | DfsStackRoom | , |
| TheRoomTakenFromTheThreadGoesBackWhenTheStackGrows | |||
| ) |
Definition at line 394 of file dfs_stack_test.cc.
References Aleph::Dfs_Stack< T >::capacity(), Aleph::next(), and Aleph::Dfs_Stack< T >::push().