|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Removals from hash tables when memory runs out. More...
#include <gtest/gtest.h>#include "allocation_failure.H"#include <cstdlib>#include <new>#include <string>#include <utility>#include <vector>#include <tpl_dynLhash.H>#include <tpl_dynSetHash.H>#include <tpl_lhash.H>#include <tpl_linHash.H>#include <tpl_odhash.H>#include <tpl_olhash.H>Go to the source code of this file.
Classes | |
| struct | HashTableWithoutMemory |
| struct | OpenTableWithoutMemory< Table > |
Typedefs | |
| using | Open_Tables = ::testing::Types< OLhashTable< long >, ODhashTable< long > > |
Functions | |
| TEST_F (HashTableWithoutMemory, ChainedRemovalKeepsTheCapacity) | |
| TEST_F (HashTableWithoutMemory, ChainedRemovalDoesNotRebuildToTheSameCapacity) | |
| TEST_F (HashTableWithoutMemory, ChainedRemovalDoesNotShrinkWhereTheKeysWouldNotFit) | |
| TYPED_TEST_SUITE (OpenTableWithoutMemory, Open_Tables) | |
| TYPED_TEST (OpenTableWithoutMemory, RemovalsKeepTheCapacity) | |
| TEST_F (HashTableWithoutMemory, LinearContractionKeepsTheTable) | |
| TEST_F (HashTableWithoutMemory, AFailedFirstInsertionInAChainedSetWithoutListsFreesItsBucket) | |
| TEST_F (HashTableWithoutMemory, AFailedFirstInsertionInAChainedMapWithoutListsFreesItsBucket) | |
| TEST_F (HashTableWithoutMemory, AFailedFirstInsertionInADynLhashTableWithoutListsFreesItsBucket) | |
| TEST_F (HashTableWithoutMemory, AFailedInsertionInALinearSetFreesItsBucket) | |
| TEST_F (HashTableWithoutMemory, AFailedFirstSearchOrInsertInAChainedSetWithoutListsFreesItsBucket) | |
| TEST_F (HashTableWithoutMemory, AFailedGrowthKeepsTheKeyThatWasInserted) | |
Removals from hash tables when memory runs out.
This program replaces the global operator new, so that a test can make every allocation fail for a while. A removal that shrinks a table which resizes itself allocates the smaller table; without memory, the removal must stand and the table must keep its capacity, without throwing.
Definition in file hash_allocation_failure_test.cc.
| using Open_Tables = ::testing::Types<OLhashTable<long>, ODhashTable<long> > |
Definition at line 192 of file hash_allocation_failure_test.cc.
| TEST_F | ( | HashTableWithoutMemory | , |
| AFailedFirstInsertionInAChainedMapWithoutListsFreesItsBucket | |||
| ) |
Definition at line 362 of file hash_allocation_failure_test.cc.
| TEST_F | ( | HashTableWithoutMemory | , |
| AFailedFirstInsertionInAChainedSetWithoutListsFreesItsBucket | |||
| ) |
Definition at line 347 of file hash_allocation_failure_test.cc.
References Primes::DefaultPrime.
| TEST_F | ( | HashTableWithoutMemory | , |
| AFailedFirstInsertionInADynLhashTableWithoutListsFreesItsBucket | |||
| ) |
Definition at line 388 of file hash_allocation_failure_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST_F | ( | HashTableWithoutMemory | , |
| AFailedFirstSearchOrInsertInAChainedSetWithoutListsFreesItsBucket | |||
| ) |
Definition at line 466 of file hash_allocation_failure_test.cc.
| TEST_F | ( | HashTableWithoutMemory | , |
| AFailedGrowthKeepsTheKeyThatWasInserted | |||
| ) |
Definition at line 496 of file hash_allocation_failure_test.cc.
References Aleph::DynHashTable< Key, HashTable, Cmp >::contains(), and Aleph::DynHashTable< Key, HashTable, Cmp >::insert().
| TEST_F | ( | HashTableWithoutMemory | , |
| AFailedInsertionInALinearSetFreesItsBucket | |||
| ) |
Definition at line 426 of file hash_allocation_failure_test.cc.
References Aleph::and, Aleph::DynHashTable< Key, HashTable, Cmp >::contains(), Aleph::DynHashTable< Key, HashTable, Cmp >::insert(), Aleph::DynHashTable< Key, HashTable, Cmp >::is_empty(), and Aleph::DynHashTable< Key, HashTable, Cmp >::remove().
| TEST_F | ( | HashTableWithoutMemory | , |
| ChainedRemovalDoesNotRebuildToTheSameCapacity | |||
| ) |
Definition at line 125 of file hash_allocation_failure_test.cc.
References Aleph::GenLhashTable< Key, BucketType, Cmp >::capacity(), Aleph::hash_default_lower_alpha, Aleph::hash_default_upper_alpha, Aleph::GenLhashTable< Key, BucketType, Cmp >::insert(), k, and Aleph::GenLhashTable< Key, BucketType, Cmp >::remove().
| TEST_F | ( | HashTableWithoutMemory | , |
| ChainedRemovalDoesNotShrinkWhereTheKeysWouldNotFit | |||
| ) |
Definition at line 153 of file hash_allocation_failure_test.cc.
References Aleph::GenLhashTable< Key, BucketType, Cmp >::capacity(), Aleph::GenLhashTable< Key, BucketType, Cmp >::insert(), k, and Aleph::GenLhashTable< Key, BucketType, Cmp >::remove().
| TEST_F | ( | HashTableWithoutMemory | , |
| ChainedRemovalKeepsTheCapacity | |||
| ) |
Definition at line 82 of file hash_allocation_failure_test.cc.
References Aleph::GenLhashTable< Key, BucketType, Cmp >::capacity(), Aleph::GenLhashTable< Key, BucketType, Cmp >::get_num_busy_slots(), Aleph::hash_default_lower_alpha, Aleph::hash_default_upper_alpha, Aleph::GenLhashTable< Key, BucketType, Cmp >::insert(), Aleph::GenLhashTable< Key, BucketType, Cmp >::is_empty(), k, Aleph::GenLhashTable< Key, BucketType, Cmp >::remove(), Aleph::GenLhashTable< Key, BucketType, Cmp >::search(), and Aleph::GenLhashTable< Key, BucketType, Cmp >::size().
| TEST_F | ( | HashTableWithoutMemory | , |
| LinearContractionKeepsTheTable | |||
| ) |
Definition at line 252 of file hash_allocation_failure_test.cc.
References Aleph::and, Aleph::GenLinearHashTable< Key, BucketType, Cmp >::busy_slots(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::capacity(), Aleph::hash_default_lower_alpha, Aleph::hash_default_upper_alpha, Aleph::GenLinearHashTable< Key, BucketType, Cmp >::insert(), r, Aleph::GenLinearHashTable< Key, BucketType, Cmp >::remove(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::search(), and Aleph::GenLinearHashTable< Key, BucketType, Cmp >::size().
| TYPED_TEST | ( | OpenTableWithoutMemory | , |
| RemovalsKeepTheCapacity | |||
| ) |
Definition at line 196 of file hash_allocation_failure_test.cc.
References k.
| TYPED_TEST_SUITE | ( | OpenTableWithoutMemory | , |
| Open_Tables | |||
| ) |