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

Tests for Ah Init Guard. More...

#include <gtest/gtest.h>
#include <stdexcept>
#include <functional>
#include <vector>
#include <ah_init_guard.H>
Include dependency graph for ah_init_guard.cc:

Go to the source code of this file.

Functions

 TEST (InitGuard, CleanupCalledOnDestruction)
 
 TEST (InitGuard, CleanupNotCalledIfReleased)
 
 TEST (InitGuard, IsReleasedGetter)
 
 TEST (InitGuard, MultipleReleaseCalls)
 
 TEST (InitGuard, CleanupCalledOnException)
 
 TEST (InitGuard, CleanupNotCalledIfReleasedBeforeException)
 
 TEST (InitGuard, MoveConstructor)
 
 TEST (InitGuard, MoveConstructorFromReleased)
 
 TEST (InitGuard, MoveAssignment)
 
 TEST (InitGuard, MoveAssignmentToReleased)
 
 TEST (InitGuard, SelfMoveAssignment)
 
 TEST (InitGuard, MakeInitGuard)
 
 TEST (InitGuard, MakeInitGuardWithRelease)
 
 TEST (InitGuard, ModifiesExternalState)
 
 TEST (InitGuard, MultipleResourceCleanup)
 
 TEST (InitGuard, CleanupOrder)
 
void free_function_cleanup (bool &flag)
 
 TEST (InitGuard, WithLambda)
 
 TEST (InitGuard, WithFunctionObject)
 
 TEST (InitGuard, WithStdFunction)
 
 TEST (InitGuard, EmptyLambda)
 
 TEST (InitGuard, NestedGuards)
 

Detailed Description

Tests for Ah Init Guard.

Comprehensive test suite for ah_init_guard.H.

Tests the RAII Init_Guard class for exception-safe cleanup.

Definition in file ah_init_guard.cc.

Function Documentation

◆ free_function_cleanup()

void free_function_cleanup ( bool &  flag)

Definition at line 353 of file ah_init_guard.cc.

◆ TEST() [1/21]

TEST ( InitGuard  ,
CleanupCalledOnDestruction   
)

Definition at line 58 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [2/21]

TEST ( InitGuard  ,
CleanupCalledOnException   
)

Definition at line 112 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [3/21]

TEST ( InitGuard  ,
CleanupNotCalledIfReleased   
)

Definition at line 70 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [4/21]

TEST ( InitGuard  ,
CleanupNotCalledIfReleasedBeforeException   
)

Definition at line 129 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [5/21]

TEST ( InitGuard  ,
CleanupOrder   
)

Definition at line 332 of file ah_init_guard.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST() [6/21]

TEST ( InitGuard  ,
EmptyLambda   
)

Definition at line 398 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [7/21]

TEST ( InitGuard  ,
IsReleasedGetter   
)

Definition at line 83 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [8/21]

TEST ( InitGuard  ,
MakeInitGuard   
)

Definition at line 267 of file ah_init_guard.cc.

References Aleph::make_init_guard(), and Aleph::maps().

◆ TEST() [9/21]

TEST ( InitGuard  ,
MakeInitGuardWithRelease   
)

Definition at line 280 of file ah_init_guard.cc.

References Aleph::make_init_guard(), and Aleph::maps().

◆ TEST() [10/21]

TEST ( InitGuard  ,
ModifiesExternalState   
)

Definition at line 296 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [11/21]

TEST ( InitGuard  ,
MoveAssignment   
)

Definition at line 189 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [12/21]

TEST ( InitGuard  ,
MoveAssignmentToReleased   
)

Definition at line 214 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [13/21]

TEST ( InitGuard  ,
MoveConstructor   
)

Definition at line 151 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [14/21]

TEST ( InitGuard  ,
MoveConstructorFromReleased   
)

Definition at line 171 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [15/21]

TEST ( InitGuard  ,
MultipleReleaseCalls   
)

Definition at line 93 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [16/21]

TEST ( InitGuard  ,
MultipleResourceCleanup   
)

Definition at line 308 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [17/21]

TEST ( InitGuard  ,
NestedGuards   
)

Definition at line 408 of file ah_init_guard.cc.

References log(), and Aleph::maps().

◆ TEST() [18/21]

TEST ( InitGuard  ,
SelfMoveAssignment   
)

Definition at line 241 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [19/21]

TEST ( InitGuard  ,
WithFunctionObject   
)

Definition at line 367 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [20/21]

TEST ( InitGuard  ,
WithLambda   
)

Definition at line 358 of file ah_init_guard.cc.

References Aleph::maps().

◆ TEST() [21/21]

TEST ( InitGuard  ,
WithStdFunction   
)

Definition at line 383 of file ah_init_guard.cc.

References Aleph::maps().