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

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

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)
 

Detailed Description

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.

Typedef Documentation

◆ Open_Tables

using Open_Tables = ::testing::Types<OLhashTable<long>, ODhashTable<long> >

Definition at line 192 of file hash_allocation_failure_test.cc.

Function Documentation

◆ TEST_F() [1/10]

TEST_F ( HashTableWithoutMemory  ,
AFailedFirstInsertionInAChainedMapWithoutListsFreesItsBucket   
)

Definition at line 362 of file hash_allocation_failure_test.cc.

◆ TEST_F() [2/10]

TEST_F ( HashTableWithoutMemory  ,
AFailedFirstInsertionInAChainedSetWithoutListsFreesItsBucket   
)

Definition at line 347 of file hash_allocation_failure_test.cc.

References Primes::DefaultPrime.

◆ TEST_F() [3/10]

TEST_F ( HashTableWithoutMemory  ,
AFailedFirstInsertionInADynLhashTableWithoutListsFreesItsBucket   
)

◆ TEST_F() [4/10]

TEST_F ( HashTableWithoutMemory  ,
AFailedFirstSearchOrInsertInAChainedSetWithoutListsFreesItsBucket   
)

Definition at line 466 of file hash_allocation_failure_test.cc.

◆ TEST_F() [5/10]

TEST_F ( HashTableWithoutMemory  ,
AFailedGrowthKeepsTheKeyThatWasInserted   
)

◆ TEST_F() [6/10]

◆ TEST_F() [7/10]

◆ TEST_F() [8/10]

◆ TEST_F() [9/10]

◆ TEST_F() [10/10]

◆ TYPED_TEST()

TYPED_TEST ( OpenTableWithoutMemory  ,
RemovalsKeepTheCapacity   
)

Definition at line 196 of file hash_allocation_failure_test.cc.

References k.

◆ TYPED_TEST_SUITE()

TYPED_TEST_SUITE ( OpenTableWithoutMemory  ,
Open_Tables   
)