Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
dfs_stack_test.cc File Reference

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>
Include dependency graph for dfs_stack_test.cc:

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)
 

Detailed Description

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.

Function Documentation

◆ TEST() [1/9]

TEST ( DfsHere  ,
AssignsTheFramesThatCanBe   
)

Definition at line 555 of file dfs_stack_test.cc.

References Aleph::dfs_frame(), Aleph::dfs_replace(), and value.

◆ TEST() [2/9]

TEST ( DfsHere  ,
ReplacesAFrameThatCannotBeAssigned   
)

◆ TEST() [3/9]

TEST ( DfsStack  ,
AMoveThatThrowsWhileGrowingFreesTheNewRoom   
)

◆ TEST() [4/9]

TEST ( DfsStack  ,
GrowingKeepsTheFrames   
)

◆ TEST() [5/9]

TEST ( DfsStack  ,
MovesTakeTheFrames   
)

◆ TEST() [6/9]

TEST ( DfsStack  ,
PopsInTheReverseOrderOfThePushes   
)

◆ TEST() [7/9]

TEST ( DfsStack  ,
TheCapacityIsThatOfTheRoom   
)

◆ TEST() [8/9]

TEST ( DfsStack  ,
TheRoomWithoutFramesIsPoisoned   
)

◆ TEST() [9/9]

TEST ( DfsStack  ,
TheThreadOfMainIsToldByItsId   
)

Definition at line 443 of file dfs_stack_test.cc.

References Aleph::dfs_stack_detail::in_main_thread().

◆ TEST_F() [1/9]

TEST_F ( CountedFrames  ,
ACopyThatThrowsWhileGrowingLeavesTheStackAsItWas   
)

◆ TEST_F() [2/9]

TEST_F ( CountedFrames  ,
AFrameThatThrowsLeavesTheStackAsItWas   
)

◆ TEST_F() [3/9]

TEST_F ( CountedFrames  ,
ClearAndTheDestructorDestroyTheFrames   
)

◆ TEST_F() [4/9]

TEST_F ( CountedFrames  ,
ReleaseDestroysTheFramesAndGivesTheRoomBack   
)

◆ TEST_F() [5/9]

TEST_F ( DfsStackRoom  ,
ALargeRoomIsNotKept   
)

◆ TEST_F() [6/9]

TEST_F ( DfsStackRoom  ,
ARoomReleasedIsReused   
)

◆ TEST_F() [7/9]

TEST_F ( DfsStackRoom  ,
AStackOfAnotherThreadHasNoRoom   
)

Definition at line 347 of file dfs_stack_test.cc.

References Aleph::Dfs_Stack< T >::push().

◆ TEST_F() [8/9]

TEST_F ( DfsStackRoom  ,
AStackOfTheSameThreadReusesTheRoom   
)

Definition at line 335 of file dfs_stack_test.cc.

References Aleph::Dfs_Stack< T >::push().

◆ TEST_F() [9/9]

TEST_F ( DfsStackRoom  ,
TheRoomTakenFromTheThreadGoesBackWhenTheStackGrows   
)