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

Exhaustive test suite for DynListStack<T> More...

#include <gtest/gtest.h>
#include <string>
#include <memory>
#include <vector>
#include <stdexcept>
#include <tpl_dynListStack.H>
#include <ahFunctional.H>
Include dependency graph for tpl_dynListStack.cc:

Go to the source code of this file.

Classes

class  DynListStackTest
 
struct  NonCopyable
 
struct  ThrowingType
 

Functions

 TEST_F (DynListStackTest, DefaultConstruction)
 
 TEST_F (DynListStackTest, CopyConstruction)
 
 TEST_F (DynListStackTest, MoveConstruction)
 
 TEST_F (DynListStackTest, InitializerListConstruction)
 
 TEST_F (DynListStackTest, IteratorRangeConstruction)
 
 TEST_F (DynListStackTest, DynListConstruction)
 
 TEST_F (DynListStackTest, CopyAssignment)
 
 TEST_F (DynListStackTest, CopyAssignmentSelf)
 
 TEST_F (DynListStackTest, MoveAssignment)
 
 TEST_F (DynListStackTest, PushByCopy)
 
 TEST_F (DynListStackTest, PushByMove)
 
 TEST_F (DynListStackTest, PushMultiple)
 
 TEST_F (DynListStackTest, PopLIFOOrder)
 
 TEST_F (DynListStackTest, PopFromEmptyStack)
 
 TEST_F (DynListStackTest, GetAlias)
 
 TEST_F (DynListStackTest, TopPeek)
 
 TEST_F (DynListStackTest, TopFromEmptyStack)
 
 TEST_F (DynListStackTest, PeekAlias)
 
 TEST_F (DynListStackTest, TopModification)
 
 TEST_F (DynListStackTest, SizeTracking)
 
 TEST_F (DynListStackTest, IsEmptyCheck)
 
 TEST_F (DynListStackTest, EmptyOperation)
 
 TEST_F (DynListStackTest, EmptyOnEmptyStack)
 
 TEST_F (DynListStackTest, ClearAlias)
 
 TEST_F (DynListStackTest, SwapStacks)
 
 TEST_F (DynListStackTest, SwapWithEmpty)
 
 TEST_F (DynListStackTest, SwapSelf)
 
 TEST_F (DynListStackTest, IteratorBasic)
 
 TEST_F (DynListStackTest, IteratorTraversalOrder)
 
 TEST_F (DynListStackTest, STLIteratorRangeFor)
 
 TEST_F (DynListStackTest, STLIteratorBeginEnd)
 
 TEST_F (DynListStackTest, STLConstIterator)
 
 TEST_F (DynListStackTest, EmptyStackIterator)
 
 TEST_F (DynListStackTest, TraverseAll)
 
 TEST_F (DynListStackTest, TraverseEarlyStop)
 
 TEST_F (DynListStackTest, TraverseEmptyStack)
 
 TEST_F (DynListStackTest, TraverseConst)
 
 TEST_F (DynListStackTest, ForEach)
 
 TEST_F (DynListStackTest, Maps)
 
 TEST_F (DynListStackTest, Filter)
 
 TEST_F (DynListStackTest, Foldl)
 
 TEST_F (DynListStackTest, All)
 
 TEST_F (DynListStackTest, Exists)
 
 TEST_F (DynListStackTest, Partition)
 
 TEST_F (DynListStackTest, Take)
 
 TEST_F (DynListStackTest, Drop)
 
 TEST_F (DynListStackTest, Rev)
 
 TEST_F (DynListStackTest, Length)
 
 TEST_F (DynListStackTest, FindPtr)
 
 TEST_F (DynListStackTest, FindPtrNotFound)
 
 TEST_F (DynListStackTest, FindIndex)
 
 TEST_F (DynListStackTest, FindItem)
 
 TEST_F (DynListStackTest, Nth)
 
 TEST_F (DynListStackTest, NthOutOfRange)
 
 TEST_F (DynListStackTest, GetIt)
 
 TEST_F (DynListStackTest, Keys)
 
 TEST_F (DynListStackTest, Items)
 
 TEST_F (DynListStackTest, TypeAliases)
 
 TEST (DynListStackComplexTypes, StringStack)
 
 TEST (DynListStackComplexTypes, UniquePtr)
 
 TEST (DynListStackComplexTypes, MoveOnlyType)
 
 TEST (DynListStackComplexTypes, ExceptionSafety)
 
 TEST (DynListStackStress, LargeStack)
 
 TEST (DynListStackStress, InterleavedOperations)
 
 TEST (DynListStackStress, RepeatedEmptyFill)
 
 TEST (DynListStackEdgeCases, SingleElement)
 
 TEST (DynListStackEdgeCases, AlternatingEmptyNonEmpty)
 
 TEST (DynListStackEdgeCases, ZeroValue)
 
 TEST (DynListStackEdgeCases, NegativeValues)
 
 TEST (DynListStackEdgeCases, EmptyString)
 
 TEST (DynListStackNoexcept, SwapIsNoexcept)
 
 TEST (DynListStackNoexcept, SizeIsNoexcept)
 
 TEST (DynListStackNoexcept, IsEmptyIsNoexcept)
 
 TEST (DynListStackNoexcept, EmptyIsNoexcept)
 
 TEST (DynListStackNoexcept, ClearIsNoexcept)
 
 TEST (DynListStackNoexcept, MoveConstructorIsNoexcept)
 
 TEST (DynListStackNoexcept, MoveAssignmentIsNoexcept)
 
 TEST (DynListStackEmplace, EmplaceBasic)
 
 TEST (DynListStackEmplace, EmplaceReturnsReference)
 
 TEST (DynListStackEmplace, EmplaceWithString)
 
 TEST (DynListStackMemory, DestructorFreesMemory)
 
 TEST (DynListStackMemory, EmptyFreesMemory)
 
 TEST (DynListStackConstCorrectness, ConstTopReturnsConstReference)
 
 TEST (DynListStackConstCorrectness, NonConstTopReturnsModifiableReference)
 
 TEST (DynListStackConstCorrectness, ConstPeekReturnsConstReference)
 
 TEST (DynListStackConstCorrectness, NonConstPeekReturnsModifiableReference)
 
 TEST (DynListStackEquality, EqualStacksAreEqual)
 
 TEST (DynListStackEquality, DifferentSizesAreNotEqual)
 
 TEST (DynListStackEquality, DifferentElementsAreNotEqual)
 
 TEST (DynListStackEquality, EmptyStacksAreEqual)
 
 TEST (DynListStackEquality, SelfEquality)
 
 TEST (DynListStackEquality, EmptyVsNonEmpty)
 
 TEST (DynListStackSearch, SearchExistingElement)
 
 TEST (DynListStackSearch, SearchNonExistingElement)
 
 TEST (DynListStackSearch, SearchInEmptyStack)
 
 TEST (DynListStackSearch, SearchTopElement)
 
 TEST (DynListStackSearch, SearchBottomElement)
 
 TEST (DynListStackSearch, ConstSearch)
 
 TEST (DynListStackSearch, SearchDuplicates)
 
 TEST (DynListStackLIFO, VerifyLIFOBehavior)
 
 TEST (DynListStackLIFO, TopAlwaysReturnsLastPushed)
 
 TEST (DynListStackCompatibility, PutAlias)
 
 TEST (DynListStackCompatibility, GetAlias)
 
 TEST (DynListStackCompatibility, InsertAlias)
 
 TEST (DynListStackCompatibility, PutAndGetSymmetry)
 
 TEST (DynListStackCompatibility, MixedOperations)
 
int main (int argc, char **argv)
 

Detailed Description

Exhaustive test suite for DynListStack<T>

This file contains comprehensive tests for the DynListStack class, covering all public methods, edge cases, exception handling, and iterator functionality.

Definition in file tpl_dynListStack.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1349 of file tpl_dynListStack.cc.

References Aleph::maps().

◆ TEST() [1/48]

TEST ( DynListStackCompatibility  ,
GetAlias   
)

◆ TEST() [2/48]

TEST ( DynListStackCompatibility  ,
InsertAlias   
)

◆ TEST() [3/48]

◆ TEST() [4/48]

TEST ( DynListStackCompatibility  ,
PutAlias   
)

◆ TEST() [5/48]

TEST ( DynListStackCompatibility  ,
PutAndGetSymmetry   
)

◆ TEST() [6/48]

TEST ( DynListStackComplexTypes  ,
ExceptionSafety   
)

◆ TEST() [7/48]

TEST ( DynListStackComplexTypes  ,
MoveOnlyType   
)

◆ TEST() [8/48]

TEST ( DynListStackComplexTypes  ,
StringStack   
)

◆ TEST() [9/48]

TEST ( DynListStackComplexTypes  ,
UniquePtr   
)

◆ TEST() [10/48]

TEST ( DynListStackConstCorrectness  ,
ConstPeekReturnsConstReference   
)

Definition at line 1086 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::peek().

◆ TEST() [11/48]

TEST ( DynListStackConstCorrectness  ,
ConstTopReturnsConstReference   
)

Definition at line 1068 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::top().

◆ TEST() [12/48]

TEST ( DynListStackConstCorrectness  ,
NonConstPeekReturnsModifiableReference   
)

◆ TEST() [13/48]

TEST ( DynListStackConstCorrectness  ,
NonConstTopReturnsModifiableReference   
)

Definition at line 1076 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::top().

◆ TEST() [14/48]

TEST ( DynListStackEdgeCases  ,
AlternatingEmptyNonEmpty   
)

◆ TEST() [15/48]

TEST ( DynListStackEdgeCases  ,
EmptyString   
)

◆ TEST() [16/48]

TEST ( DynListStackEdgeCases  ,
NegativeValues   
)

◆ TEST() [17/48]

◆ TEST() [18/48]

TEST ( DynListStackEdgeCases  ,
ZeroValue   
)

◆ TEST() [19/48]

TEST ( DynListStackEmplace  ,
EmplaceBasic   
)

◆ TEST() [20/48]

TEST ( DynListStackEmplace  ,
EmplaceReturnsReference   
)

◆ TEST() [21/48]

TEST ( DynListStackEmplace  ,
EmplaceWithString   
)

◆ TEST() [22/48]

TEST ( DynListStackEquality  ,
DifferentElementsAreNotEqual   
)

Definition at line 1131 of file tpl_dynListStack.cc.

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

◆ TEST() [23/48]

TEST ( DynListStackEquality  ,
DifferentSizesAreNotEqual   
)

Definition at line 1120 of file tpl_dynListStack.cc.

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

◆ TEST() [24/48]

TEST ( DynListStackEquality  ,
EmptyStacksAreEqual   
)

Definition at line 1142 of file tpl_dynListStack.cc.

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

◆ TEST() [25/48]

TEST ( DynListStackEquality  ,
EmptyVsNonEmpty   
)

Definition at line 1164 of file tpl_dynListStack.cc.

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

◆ TEST() [26/48]

TEST ( DynListStackEquality  ,
EqualStacksAreEqual   
)

Definition at line 1108 of file tpl_dynListStack.cc.

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

◆ TEST() [27/48]

TEST ( DynListStackEquality  ,
SelfEquality   
)

Definition at line 1153 of file tpl_dynListStack.cc.

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

◆ TEST() [28/48]

TEST ( DynListStackLIFO  ,
TopAlwaysReturnsLastPushed   
)

◆ TEST() [29/48]

TEST ( DynListStackLIFO  ,
VerifyLIFOBehavior   
)

◆ TEST() [30/48]

TEST ( DynListStackMemory  ,
DestructorFreesMemory   
)

Definition at line 1035 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::push().

◆ TEST() [31/48]

◆ TEST() [32/48]

TEST ( DynListStackNoexcept  ,
ClearIsNoexcept   
)

Definition at line 970 of file tpl_dynListStack.cc.

References Aleph::DynListStack< T >::clear().

◆ TEST() [33/48]

TEST ( DynListStackNoexcept  ,
EmptyIsNoexcept   
)

Definition at line 964 of file tpl_dynListStack.cc.

References Aleph::DynListStack< T >::empty().

◆ TEST() [34/48]

TEST ( DynListStackNoexcept  ,
IsEmptyIsNoexcept   
)

Definition at line 958 of file tpl_dynListStack.cc.

References Aleph::DynListStack< T >::is_empty().

◆ TEST() [35/48]

TEST ( DynListStackNoexcept  ,
MoveAssignmentIsNoexcept   
)

Definition at line 982 of file tpl_dynListStack.cc.

◆ TEST() [36/48]

TEST ( DynListStackNoexcept  ,
MoveConstructorIsNoexcept   
)

Definition at line 976 of file tpl_dynListStack.cc.

◆ TEST() [37/48]

TEST ( DynListStackNoexcept  ,
SizeIsNoexcept   
)

Definition at line 952 of file tpl_dynListStack.cc.

References Aleph::DynListStack< T >::size().

◆ TEST() [38/48]

TEST ( DynListStackNoexcept  ,
SwapIsNoexcept   
)

Definition at line 946 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynList< T >::swap().

◆ TEST() [39/48]

TEST ( DynListStackSearch  ,
ConstSearch   
)

Definition at line 1222 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [40/48]

TEST ( DynListStackSearch  ,
SearchBottomElement   
)

Definition at line 1213 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [41/48]

TEST ( DynListStackSearch  ,
SearchDuplicates   
)

Definition at line 1231 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [42/48]

TEST ( DynListStackSearch  ,
SearchExistingElement   
)

Definition at line 1179 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [43/48]

TEST ( DynListStackSearch  ,
SearchInEmptyStack   
)

Definition at line 1196 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [44/48]

TEST ( DynListStackSearch  ,
SearchNonExistingElement   
)

Definition at line 1188 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [45/48]

TEST ( DynListStackSearch  ,
SearchTopElement   
)

Definition at line 1204 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::search().

◆ TEST() [46/48]

TEST ( DynListStackStress  ,
InterleavedOperations   
)

◆ TEST() [47/48]

◆ TEST() [48/48]

◆ TEST_F() [1/58]

TEST_F ( DynListStackTest  ,
All   
)

Definition at line 567 of file tpl_dynListStack.cc.

References FunctionalMethods< Container, T >::all(), and Aleph::maps().

◆ TEST_F() [2/58]

◆ TEST_F() [3/58]

◆ TEST_F() [4/58]

TEST_F ( DynListStackTest  ,
CopyAssignmentSelf   
)

◆ TEST_F() [5/58]

TEST_F ( DynListStackTest  ,
CopyConstruction   
)

Definition at line 86 of file tpl_dynListStack.cc.

References Aleph::copy(), Aleph::maps(), and N.

◆ TEST_F() [6/58]

TEST_F ( DynListStackTest  ,
DefaultConstruction   
)

◆ TEST_F() [7/58]

TEST_F ( DynListStackTest  ,
Drop   
)

◆ TEST_F() [8/58]

TEST_F ( DynListStackTest  ,
DynListConstruction   
)

◆ TEST_F() [9/58]

TEST_F ( DynListStackTest  ,
EmptyOnEmptyStack   
)

Definition at line 333 of file tpl_dynListStack.cc.

References Aleph::maps().

◆ TEST_F() [10/58]

TEST_F ( DynListStackTest  ,
EmptyOperation   
)

Definition at line 323 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [11/58]

TEST_F ( DynListStackTest  ,
EmptyStackIterator   
)

Definition at line 465 of file tpl_dynListStack.cc.

References Aleph::HTList::Iterator::has_curr(), and Aleph::maps().

◆ TEST_F() [12/58]

TEST_F ( DynListStackTest  ,
Exists   
)

◆ TEST_F() [13/58]

TEST_F ( DynListStackTest  ,
Filter   
)

◆ TEST_F() [14/58]

TEST_F ( DynListStackTest  ,
FindIndex   
)

Definition at line 640 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [15/58]

TEST_F ( DynListStackTest  ,
FindItem   
)

Definition at line 649 of file tpl_dynListStack.cc.

References Aleph::maps().

◆ TEST_F() [16/58]

TEST_F ( DynListStackTest  ,
FindPtr   
)

Definition at line 625 of file tpl_dynListStack.cc.

References Aleph::maps().

◆ TEST_F() [17/58]

TEST_F ( DynListStackTest  ,
FindPtrNotFound   
)

Definition at line 633 of file tpl_dynListStack.cc.

References Aleph::maps().

◆ TEST_F() [18/58]

TEST_F ( DynListStackTest  ,
Foldl   
)

◆ TEST_F() [19/58]

TEST_F ( DynListStackTest  ,
ForEach   
)

Definition at line 529 of file tpl_dynListStack.cc.

References Aleph::maps(), N, and Aleph::sum().

◆ TEST_F() [20/58]

TEST_F ( DynListStackTest  ,
GetAlias   
)

Definition at line 242 of file tpl_dynListStack.cc.

References Aleph::DynListStack< T >::get(), and Aleph::maps().

◆ TEST_F() [21/58]

TEST_F ( DynListStackTest  ,
GetIt   
)

Definition at line 669 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [22/58]

TEST_F ( DynListStackTest  ,
InitializerListConstruction   
)

◆ TEST_F() [23/58]

◆ TEST_F() [24/58]

TEST_F ( DynListStackTest  ,
Items   
)

Definition at line 688 of file tpl_dynListStack.cc.

References GenericItems< Container, T >::items(), and Aleph::maps().

◆ TEST_F() [25/58]

◆ TEST_F() [26/58]

◆ TEST_F() [27/58]

◆ TEST_F() [28/58]

TEST_F ( DynListStackTest  ,
Keys   
)

Definition at line 680 of file tpl_dynListStack.cc.

References GenericItems< Container, T >::keys(), and Aleph::maps().

◆ TEST_F() [29/58]

TEST_F ( DynListStackTest  ,
Length   
)

Definition at line 615 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [30/58]

TEST_F ( DynListStackTest  ,
Maps   
)

◆ TEST_F() [31/58]

TEST_F ( DynListStackTest  ,
MoveAssignment   
)

◆ TEST_F() [32/58]

◆ TEST_F() [33/58]

TEST_F ( DynListStackTest  ,
Nth   
)

Definition at line 657 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [34/58]

TEST_F ( DynListStackTest  ,
NthOutOfRange   
)

Definition at line 663 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [35/58]

TEST_F ( DynListStackTest  ,
Partition   
)

◆ TEST_F() [36/58]

TEST_F ( DynListStackTest  ,
PeekAlias   
)

◆ TEST_F() [37/58]

TEST_F ( DynListStackTest  ,
PopFromEmptyStack   
)

Definition at line 236 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::pop().

◆ TEST_F() [38/58]

◆ TEST_F() [39/58]

◆ TEST_F() [40/58]

TEST_F ( DynListStackTest  ,
PushByMove   
)

◆ TEST_F() [41/58]

◆ TEST_F() [42/58]

TEST_F ( DynListStackTest  ,
Rev   
)

◆ TEST_F() [43/58]

◆ TEST_F() [44/58]

TEST_F ( DynListStackTest  ,
STLConstIterator   
)

Definition at line 454 of file tpl_dynListStack.cc.

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

◆ TEST_F() [45/58]

TEST_F ( DynListStackTest  ,
STLIteratorBeginEnd   
)

◆ TEST_F() [46/58]

TEST_F ( DynListStackTest  ,
STLIteratorRangeFor   
)

Definition at line 429 of file tpl_dynListStack.cc.

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

◆ TEST_F() [47/58]

◆ TEST_F() [48/58]

TEST_F ( DynListStackTest  ,
SwapStacks   
)

◆ TEST_F() [49/58]

◆ TEST_F() [50/58]

TEST_F ( DynListStackTest  ,
Take   
)

◆ TEST_F() [51/58]

TEST_F ( DynListStackTest  ,
TopFromEmptyStack   
)

Definition at line 264 of file tpl_dynListStack.cc.

References Aleph::maps(), and Aleph::DynListStack< T >::top().

◆ TEST_F() [52/58]

TEST_F ( DynListStackTest  ,
TopModification   
)

◆ TEST_F() [53/58]

TEST_F ( DynListStackTest  ,
TopPeek   
)

Definition at line 251 of file tpl_dynListStack.cc.

References Aleph::maps(), and N.

◆ TEST_F() [54/58]

TEST_F ( DynListStackTest  ,
TraverseAll   
)

Definition at line 477 of file tpl_dynListStack.cc.

References Aleph::maps(), N, and Aleph::sum().

◆ TEST_F() [55/58]

TEST_F ( DynListStackTest  ,
TraverseConst   
)

◆ TEST_F() [56/58]

TEST_F ( DynListStackTest  ,
TraverseEarlyStop   
)

Definition at line 489 of file tpl_dynListStack.cc.

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

◆ TEST_F() [57/58]

TEST_F ( DynListStackTest  ,
TraverseEmptyStack   
)

Definition at line 500 of file tpl_dynListStack.cc.

References Aleph::maps().

◆ TEST_F() [58/58]

TEST_F ( DynListStackTest  ,
TypeAliases   
)

Definition at line 700 of file tpl_dynListStack.cc.

References Aleph::maps().