|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
EXHAUSTIVE and RIGOROUS tests for AhArenaAllocator. More...
#include <gtest/gtest.h>#include <ah-arena.H>#include <algorithm>#include <chrono>#include <cstdint>#include <limits>#include <random>#include <stdexcept>#include <string>#include <type_traits>#include <vector>Go to the source code of this file.
Functions | |
| TEST (ArenaStress, ThousandSmallAllocations) | |
| TEST (ArenaStress, MixedSizeAllocations) | |
| TEST (ArenaStress, ThousandTypedAllocations) | |
| TEST (ArenaFragmentation, AlternatingSmallLarge) | |
| TEST (ArenaFragmentation, WorstCasePattern) | |
| TEST (ArenaFragmentation, RepeatedResetAndReuse) | |
| TEST (ArenaExceptionSafety, ConstructorThrows) | |
| TEST (ArenaExceptionSafety, PartialAllocationRecovery) | |
| TEST (ArenaPolymorphism, VirtualDispatch) | |
| TEST (ArenaComplexObjects, StringMembers) | |
| TEST (ArenaAlignmentAdvanced, CacheLineAlignment) | |
| TEST (ArenaAlignmentAdvanced, MixedAlignments) | |
| TEST (ArenaAlignmentAdvanced, VeryLargeAlignment) | |
| TEST (ArenaBoundary, AllocationAtExactCapacity) | |
| TEST (ArenaBoundary, SingleByteAllocations) | |
| TEST (ArenaBoundary, AlignmentPaddingAtBoundary) | |
| TEST (ArenaLIFO, DeepNesting) | |
| TEST (ArenaLIFO, InterleavedTypedAllocations) | |
| TEST (ArenaPerformance, LargeScaleAllocation) | |
| TEST (ArenaPerformance, CompareWithMalloc) | |
| TEST (ArenaStatistical, RandomizedStressTest) | |
| TEST (ArenaEdgeCases, MaxSizeAllocation) | |
| TEST (ArenaEdgeCases, AlignmentNotPowerOfTwo) | |
| TEST (ArenaEdgeCases, ConstBufferUsage) | |
| TEST (ArenaEdgeCases, ZeroCapacityArena) | |
| TEST (ArenaIntegration, RealWorldUsagePattern) | |
| int | main (int argc, char **argv) |
EXHAUSTIVE and RIGOROUS tests for AhArenaAllocator.
This file complements ah_arena_test.cc with:
COMPILE: g++ -std=c++20 -O2 -I.. -o ah_arena_exhaustive_test ah_arena_exhaustive_test.cc -lgtest -lgtest_main -pthread
RUN: ./ah_arena_exhaustive_test valgrind –leak-check=full ./ah_arena_exhaustive_test # For leak detection
Definition in file ah_arena_exhaustive_test.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1019 of file ah_arena_exhaustive_test.cc.
References Aleph::maps().
| TEST | ( | ArenaAlignmentAdvanced | , |
| CacheLineAlignment | |||
| ) |
Definition at line 529 of file ah_arena_exhaustive_test.cc.
References Aleph::deallocate(), and Aleph::maps().
| TEST | ( | ArenaAlignmentAdvanced | , |
| MixedAlignments | |||
| ) |
Definition at line 550 of file ah_arena_exhaustive_test.cc.
References Aleph::maps().
| TEST | ( | ArenaAlignmentAdvanced | , |
| VeryLargeAlignment | |||
| ) |
Definition at line 576 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc_aligned(), and Aleph::maps().
| TEST | ( | ArenaBoundary | , |
| AlignmentPaddingAtBoundary | |||
| ) |
Definition at line 649 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::alloc_aligned(), Aleph::AhArenaAllocator::available_size(), and Aleph::maps().
| TEST | ( | ArenaBoundary | , |
| AllocationAtExactCapacity | |||
| ) |
Definition at line 600 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), Aleph::AhArenaAllocator::available_size(), Aleph::AhArenaAllocator::full(), and Aleph::maps().
| TEST | ( | ArenaBoundary | , |
| SingleByteAllocations | |||
| ) |
Definition at line 623 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::full(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | ArenaComplexObjects | , |
| StringMembers | |||
| ) |
Definition at line 485 of file ah_arena_exhaustive_test.cc.
References Aleph::deallocate(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | ArenaEdgeCases | , |
| AlignmentNotPowerOfTwo | |||
| ) |
Definition at line 915 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc_aligned(), and Aleph::maps().
| TEST | ( | ArenaEdgeCases | , |
| ConstBufferUsage | |||
| ) |
Definition at line 934 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::is_valid(), Aleph::maps(), and Aleph::AhArenaAllocator::owns_memory().
| TEST | ( | ArenaEdgeCases | , |
| MaxSizeAllocation | |||
| ) |
Definition at line 900 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), and Aleph::maps().
| TEST | ( | ArenaEdgeCases | , |
| ZeroCapacityArena | |||
| ) |
Definition at line 948 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::capacity(), Aleph::AhArenaAllocator::empty(), Aleph::AhArenaAllocator::full(), Aleph::AhArenaAllocator::is_valid(), and Aleph::maps().
| TEST | ( | ArenaExceptionSafety | , |
| ConstructorThrows | |||
| ) |
Definition at line 384 of file ah_arena_exhaustive_test.cc.
References Aleph::maps().
| TEST | ( | ArenaExceptionSafety | , |
| PartialAllocationRecovery | |||
| ) |
Definition at line 408 of file ah_arena_exhaustive_test.cc.
References Aleph::deallocate(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | ArenaFragmentation | , |
| AlternatingSmallLarge | |||
| ) |
Definition at line 302 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), and Aleph::maps().
| TEST | ( | ArenaFragmentation | , |
| RepeatedResetAndReuse | |||
| ) |
Definition at line 349 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), Aleph::AhArenaAllocator::empty(), Aleph::maps(), Aleph::AhArenaAllocator::reset(), rng, and Aleph::size().
| TEST | ( | ArenaFragmentation | , |
| WorstCasePattern | |||
| ) |
Definition at line 324 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), and Aleph::maps().
| TEST | ( | ArenaIntegration | , |
| RealWorldUsagePattern | |||
| ) |
Definition at line 966 of file ah_arena_exhaustive_test.cc.
References Aleph::deallocate(), Aleph::AhArenaAllocator::empty(), and Aleph::maps().
| TEST | ( | ArenaLIFO | , |
| DeepNesting | |||
| ) |
Definition at line 677 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), Aleph::AhArenaAllocator::dealloc(), Aleph::AhArenaAllocator::empty(), Aleph::maps(), and Aleph::size().
| TEST | ( | ArenaLIFO | , |
| InterleavedTypedAllocations | |||
| ) |
Definition at line 724 of file ah_arena_exhaustive_test.cc.
References Aleph::deallocate(), Aleph::AhArenaAllocator::empty(), Aleph::DynList< T >::empty(), Aleph::maps(), and Aleph::AhArenaAllocator::reset().
| TEST | ( | ArenaPerformance | , |
| CompareWithMalloc | |||
| ) |
Definition at line 795 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), and Aleph::maps().
| TEST | ( | ArenaPerformance | , |
| LargeScaleAllocation | |||
| ) |
Definition at line 765 of file ah_arena_exhaustive_test.cc.
References Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | ArenaPolymorphism | , |
| VirtualDispatch | |||
| ) |
Definition at line 446 of file ah_arena_exhaustive_test.cc.
References Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | ArenaStatistical | , |
| RandomizedStressTest | |||
| ) |
Definition at line 839 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::dealloc(), Aleph::DynList< T >::empty(), Aleph::maps(), rng, and Aleph::size().
| TEST | ( | ArenaStress | , |
| MixedSizeAllocations | |||
| ) |
Definition at line 240 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), Aleph::maps(), rng, Aleph::HTList::size(), and Aleph::size().
| TEST | ( | ArenaStress | , |
| ThousandSmallAllocations | |||
| ) |
Definition at line 214 of file ah_arena_exhaustive_test.cc.
References Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::allocated_size(), StlAlephIterator< SetName >::begin(), StlAlephIterator< SetName >::end(), Aleph::AhArenaAllocator::full(), and Aleph::maps().
| TEST | ( | ArenaStress | , |
| ThousandTypedAllocations | |||
| ) |
Definition at line 268 of file ah_arena_exhaustive_test.cc.
References Aleph::deallocate(), Aleph::AhArenaAllocator::empty(), Aleph::maps(), and Aleph::HTList::size().