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

Tests for Hash It. More...

#include <gtest/gtest.h>
#include <ahFunctional.H>
#include <ahSort.H>
#include <tpl_dynMapOhash.H>
#include <tpl_dynSetHash.H>
#include <tpl_olhash.H>
#include <tpl_odhash.H>
#include <tpl_lhash.H>
#include <stdexcept>
#include <functional>
Include dependency graph for hash-it.cc:

Go to the source code of this file.

Classes

struct  OHashTest< HashTbl >
 
struct  EmptyOHashTest< HashTbl >
 

Typedefs

using P = pair< size_t, string >
 
using HashTypes = Types< MapODhash< size_t, string >, MapOLhash< size_t, string >, DynMapLinHash< size_t, string >, DynMapHash< size_t, string > >
 

Functions

 TYPED_TEST_CASE_P (OHashTest)
 
 TYPED_TEST_CASE_P (EmptyOHashTest)
 
 TYPED_TEST_P (EmptyOHashTest, With_exception)
 
 TYPED_TEST_P (OHashTest, Without_exception)
 
 REGISTER_TYPED_TEST_CASE_P (EmptyOHashTest, With_exception)
 
 REGISTER_TYPED_TEST_CASE_P (OHashTest, Without_exception)
 
 INSTANTIATE_TYPED_TEST_CASE_P (Empty, EmptyOHashTest, HashTypes)
 
 INSTANTIATE_TYPED_TEST_CASE_P (NoEmpty, OHashTest, HashTypes)
 
 TEST (OLhashTable, DoubleHashCtorAndOps)
 
 TEST (OLhashTable, KeyToBucketRoundTrip)
 
 TEST (OLhashTable, RemoveThrowsOnMissingKey)
 
 TEST (OLhashTable, InsertRejectsDuplicate)
 
 TEST (OLhashTable, RemovePtrMarksDeleted)
 
 TEST (OLhashTable, NoResizeFillAndSearchMiss)
 
 TEST (OLhashTable, StatsWithDeletedAndBusy)
 
 TEST (OLhashTable, RehashKeepsElements)
 
 TEST (OLhashTable, ConstantHashCollisionsNoResize)
 
 TEST (OLhashTable, RehashAfterDeletesPreservesLiveKeys)
 
 TEST (OLhashTable, SearchOrInsertBehavior)
 
 TEST (OLhashTable, CopyMoveAndSwap)
 
 TEST (OLhashTable, StatsExtremes)
 
 TEST (OLhashTable, CleanTableLeavesEmpty)
 
 TEST (OLhashTable, InsertFailsWhenFullNoResize)
 
 TEST (OLhashTable, ResizeIncreasesCapacity)
 
 TEST (OLhashTable, DeletedSlotIsReused)
 
 TEST (ODhashTable, RemoveMissingInFullTableDoesNotHang)
 
 TEST (ODhashTable, DuplicateInsertAndSearchOrInsert)
 
 TEST (ODhashTable, CopyMoveAssignAndSwap)
 
 TEST (ODhashTable, StatsWithBusyDeletedEmpty)
 
 TEST (ODhashTable, CustomSecondHashSetter)
 
 TEST (ODhashTable, StatsAvgVarFinite)
 
 TEST (ODhashTable, StatsControlledProbes)
 
 TEST (ODhashTable, RehashWithResizeKeepsElements)
 
 TEST (ODhashTable, LinearProbePathCovered)
 
 TEST (ODhashTable, IteratorCollectsAllKeys)
 
 TEST (LhashTable, BusySlotsAfterLastRemoval)
 
 TEST (LhashTable, ShrinksWhenLoadFallsBelowLowerAlpha)
 
 TEST (LhashTable, IteratorDelRemovesAllCollidingBuckets)
 
 TEST (LhashTable, SearchOrInsertReturnsExisting)
 
 TEST (LhashTable, MoveSemanticsPreserveContent)
 
 TEST (LhashTable, InsertRejectsDuplicateAndSearchFinds)
 
 TEST (LhashTable, SearchNextReturnsNullWhenNoDuplicateKey)
 
 TEST (LhashTable, IteratorBoundsThrow)
 
 TEST (LhashTable, EmptyResetsCountersAndBuckets)
 
 TEST (LhashTable, RemoveAllBucketsFalseKeepsOwnership)
 
 TEST (LhashTable, SwapExchangesState)
 
 TEST (LhashTable, SetHashFunctionChangesDistribution)
 
 TEST (LhashTable, NoResizeModeKeepsCapacity)
 
 TEST (LhashTable, CustomComparatorActsAsEquality)
 
 TEST (LhashTable, CurrentAlphaNonZero)
 

Variables

constexpr size_t N = 1000
 

Detailed Description

Tests for Hash It.

Definition in file hash-it.cc.

Typedef Documentation

◆ HashTypes

using HashTypes = Types<MapODhash<size_t, string>, MapOLhash<size_t, string>, DynMapLinHash<size_t, string>, DynMapHash<size_t, string> >

Definition at line 123 of file hash-it.cc.

◆ P

using P = pair<size_t, string>

Definition at line 53 of file hash-it.cc.

Function Documentation

◆ INSTANTIATE_TYPED_TEST_CASE_P() [1/2]

INSTANTIATE_TYPED_TEST_CASE_P ( Empty  ,
EmptyOHashTest  ,
HashTypes   
)

◆ INSTANTIATE_TYPED_TEST_CASE_P() [2/2]

INSTANTIATE_TYPED_TEST_CASE_P ( NoEmpty  ,
OHashTest  ,
HashTypes   
)

◆ REGISTER_TYPED_TEST_CASE_P() [1/2]

REGISTER_TYPED_TEST_CASE_P ( EmptyOHashTest  ,
With_exception   
)

◆ REGISTER_TYPED_TEST_CASE_P() [2/2]

REGISTER_TYPED_TEST_CASE_P ( OHashTest  ,
Without_exception   
)

◆ TEST() [1/42]

TEST ( LhashTable  ,
BusySlotsAfterLastRemoval   
)

◆ TEST() [2/42]

TEST ( LhashTable  ,
CurrentAlphaNonZero   
)

Definition at line 861 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [3/42]

TEST ( LhashTable  ,
CustomComparatorActsAsEquality   
)

◆ TEST() [4/42]

TEST ( LhashTable  ,
EmptyResetsCountersAndBuckets   
)

◆ TEST() [5/42]

TEST ( LhashTable  ,
InsertRejectsDuplicateAndSearchFinds   
)

Definition at line 670 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [6/42]

TEST ( LhashTable  ,
IteratorBoundsThrow   
)

Definition at line 712 of file hash-it.cc.

References Aleph::Dlink::insert(), Aleph::maps(), and tbl.

◆ TEST() [7/42]

TEST ( LhashTable  ,
IteratorDelRemovesAllCollidingBuckets   
)

◆ TEST() [8/42]

◆ TEST() [9/42]

TEST ( LhashTable  ,
NoResizeModeKeepsCapacity   
)

◆ TEST() [10/42]

TEST ( LhashTable  ,
RemoveAllBucketsFalseKeepsOwnership   
)

◆ TEST() [11/42]

TEST ( LhashTable  ,
SearchNextReturnsNullWhenNoDuplicateKey   
)

◆ TEST() [12/42]

TEST ( LhashTable  ,
SearchOrInsertReturnsExisting   
)

Definition at line 635 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [13/42]

TEST ( LhashTable  ,
SetHashFunctionChangesDistribution   
)

Definition at line 801 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [14/42]

TEST ( LhashTable  ,
ShrinksWhenLoadFallsBelowLowerAlpha   
)

Definition at line 589 of file hash-it.cc.

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

◆ TEST() [15/42]

◆ TEST() [16/42]

◆ TEST() [17/42]

TEST ( ODhashTable  ,
CustomSecondHashSetter   
)

Definition at line 488 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [18/42]

TEST ( ODhashTable  ,
DuplicateInsertAndSearchOrInsert   
)

Definition at line 430 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [19/42]

TEST ( ODhashTable  ,
IteratorCollectsAllKeys   
)

Definition at line 547 of file hash-it.cc.

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

◆ TEST() [20/42]

TEST ( ODhashTable  ,
LinearProbePathCovered   
)

Definition at line 538 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [21/42]

TEST ( ODhashTable  ,
RehashWithResizeKeepsElements   
)

Definition at line 521 of file hash-it.cc.

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

◆ TEST() [22/42]

TEST ( ODhashTable  ,
RemoveMissingInFullTableDoesNotHang   
)

◆ TEST() [23/42]

TEST ( ODhashTable  ,
StatsAvgVarFinite   
)

Definition at line 497 of file hash-it.cc.

References OhashCommon< HashTbl, Key >::insert(), Aleph::maps(), and tbl.

◆ TEST() [24/42]

TEST ( ODhashTable  ,
StatsControlledProbes   
)

Definition at line 506 of file hash-it.cc.

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

◆ TEST() [25/42]

TEST ( ODhashTable  ,
StatsWithBusyDeletedEmpty   
)

◆ TEST() [26/42]

TEST ( OLhashTable  ,
CleanTableLeavesEmpty   
)

Definition at line 361 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [27/42]

TEST ( OLhashTable  ,
ConstantHashCollisionsNoResize   
)

◆ TEST() [28/42]

◆ TEST() [29/42]

TEST ( OLhashTable  ,
DeletedSlotIsReused   
)

◆ TEST() [30/42]

TEST ( OLhashTable  ,
DoubleHashCtorAndOps   
)

◆ TEST() [31/42]

TEST ( OLhashTable  ,
InsertFailsWhenFullNoResize   
)

◆ TEST() [32/42]

TEST ( OLhashTable  ,
InsertRejectsDuplicate   
)

◆ TEST() [33/42]

TEST ( OLhashTable  ,
KeyToBucketRoundTrip   
)

Definition at line 155 of file hash-it.cc.

References OhashCommon< HashTbl, Key >::insert(), Aleph::maps(), and tbl.

◆ TEST() [34/42]

TEST ( OLhashTable  ,
NoResizeFillAndSearchMiss   
)

◆ TEST() [35/42]

TEST ( OLhashTable  ,
RehashAfterDeletesPreservesLiveKeys   
)

Definition at line 261 of file hash-it.cc.

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

◆ TEST() [36/42]

TEST ( OLhashTable  ,
RehashKeepsElements   
)

Definition at line 229 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [37/42]

TEST ( OLhashTable  ,
RemovePtrMarksDeleted   
)

◆ TEST() [38/42]

TEST ( OLhashTable  ,
RemoveThrowsOnMissingKey   
)

Definition at line 168 of file hash-it.cc.

References OhashCommon< HashTbl, Key >::insert(), Aleph::maps(), and tbl.

◆ TEST() [39/42]

TEST ( OLhashTable  ,
ResizeIncreasesCapacity   
)

Definition at line 382 of file hash-it.cc.

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

◆ TEST() [40/42]

TEST ( OLhashTable  ,
SearchOrInsertBehavior   
)

Definition at line 285 of file hash-it.cc.

References Aleph::maps(), and tbl.

◆ TEST() [41/42]

TEST ( OLhashTable  ,
StatsExtremes   
)

◆ TEST() [42/42]

TEST ( OLhashTable  ,
StatsWithDeletedAndBusy   
)

◆ TYPED_TEST_CASE_P() [1/2]

TYPED_TEST_CASE_P ( EmptyOHashTest  )

◆ TYPED_TEST_CASE_P() [2/2]

TYPED_TEST_CASE_P ( OHashTest  )

◆ TYPED_TEST_P() [1/2]

TYPED_TEST_P ( EmptyOHashTest  ,
With_exception   
)

Definition at line 82 of file hash-it.cc.

References LocateFunctions< Container, Type >::get_it(), Aleph::maps(), and tbl.

◆ TYPED_TEST_P() [2/2]

TYPED_TEST_P ( OHashTest  ,
Without_exception   
)

Variable Documentation

◆ N

constexpr size_t N = 1000
constexpr

Definition at line 55 of file hash-it.cc.

Referenced by TYPED_TEST_P().