|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Comprehensive tests for DynLhashTable (dynamic hash table with chaining) More...
#include <gtest/gtest.h>#include <tpl_dynLhash.H>#include <cctype>#include <stdexcept>#include <string>#include <type_traits>#include <vector>#include <random>Go to the source code of this file.
Classes | |
| class | DynLhashTableTest |
| struct | ComplexValue |
Functions | |
| TEST_F (DynLhashTableTest, InsertAndSearch) | |
| TEST_F (DynLhashTableTest, SearchNonExistent) | |
| TEST_F (DynLhashTableTest, InsertMultiple) | |
| TEST_F (DynLhashTableTest, Remove) | |
| TEST_F (DynLhashTableTest, UpdateExisting) | |
| TEST_F (DynLhashTableTest, BracketOperatorInsert) | |
| TEST_F (DynLhashTableTest, BracketOperatorUpdate) | |
| TEST_F (DynLhashTableTest, BracketOperatorReadExisting) | |
| TEST_F (DynLhashTableTest, BracketOperatorReadNonExisting) | |
| TEST_F (DynLhashTableTest, CopyConstructor) | |
| TEST_F (DynLhashTableTest, CopyAssignment) | |
| TEST_F (DynLhashTableTest, MoveConstructor) | |
| TEST_F (DynLhashTableTest, MoveAssignment) | |
| TEST_F (DynLhashTableTest, SelfAssignment) | |
| TEST (DynLhashTableStringKey, BasicOperations) | |
| TEST (DynLhashTableStringKey, LongStrings) | |
| TEST (DynLhashTableCollision, SameHashBucket) | |
| TEST (DynLhashTableMoveValue, MoveInsert) | |
| TEST (DynLhashTableMoveValue, MoveKeyAndValue) | |
| TEST (DynLhashTableStress, ManyInsertions) | |
| TEST (DynLhashTableStress, ManyInsertionsAndRemovals) | |
| TEST (DynLhashTableStress, RandomOperations) | |
| TEST_F (DynLhashTableTest, EmptyTable) | |
| TEST_F (DynLhashTableTest, NegativeKeys) | |
| TEST_F (DynLhashTableTest, SameKeyMultipleInserts) | |
| size_t | custom_hash (const int &key) |
| TEST (DynLhashTableCustomHash, WithCustomHashFunction) | |
| TEST (DynLhashTableSwap, SwapTables) | |
| TEST (DynLhashTableSwap, SwapWithEmpty) | |
| TEST (DynLhashTablePostMove, MoveConstructorTransfersOwnership) | |
| TEST (DynLhashTablePostMove, MoveAssignmentTransfersOwnership) | |
| TEST (DynLhashTableComplexType, MoveSemanticsPropagated) | |
| TEST (DynLhashTableDuplicates, InsertRefusesAKeyAlreadyThere) | |
| TEST (DynLhashTableDuplicates, RefusedKeyLeavesTheSizeRight) | |
| TEST (DynLhashTableStress, LargeScaleWithVerification) | |
| TEST (DynLhashTableStress, InterleavedInsertRemove) | |
| TEST_F (DynLhashTableTest, IteratorSafety) | |
| TEST (DynLhashTableConfiguration, UsesItsComparator) | |
| TEST (DynLhashTableConfiguration, CopyKeepsTheConfiguration) | |
| TEST (DynLhashTableConfiguration, CopiesAKeyWithoutDefaultHash) | |
| TEST (DynLhashTableConfiguration, AssignmentTakesTheConfigurationOrNothing) | |
| int | main (int argc, char **argv) |
Comprehensive tests for DynLhashTable (dynamic hash table with chaining)
Definition in file tpl_dynLhash_test.cc.
| size_t custom_hash | ( | const int & | key | ) |
Definition at line 424 of file tpl_dynLhash_test.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 874 of file tpl_dynLhash_test.cc.
| TEST | ( | DynLhashTableCollision | , |
| SameHashBucket | |||
| ) |
Definition at line 249 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableComplexType | , |
| MoveSemanticsPropagated | |||
| ) |
Definition at line 562 of file tpl_dynLhash_test.cc.
References ComplexValue::copy_count, Aleph::DynLhashTable< Key, Record, Cmp >::insert(), ComplexValue::move_count, and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableConfiguration | , |
| AssignmentTakesTheConfigurationOrNothing | |||
| ) |
Definition at line 845 of file tpl_dynLhash_test.cc.
References Aleph::GenLhashTable< Key, BucketType, Cmp >::capacity(), HashStats< HashTbl >::get_with_resize(), Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), and Aleph::GenLhashTable< Key, BucketType, Cmp >::size().
| TEST | ( | DynLhashTableConfiguration | , |
| CopiesAKeyWithoutDefaultHash | |||
| ) |
Definition at line 821 of file tpl_dynLhash_test.cc.
References Aleph::copy(), Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableConfiguration | , |
| CopyKeepsTheConfiguration | |||
| ) |
Definition at line 794 of file tpl_dynLhash_test.cc.
References Aleph::GenLhashTable< Key, BucketType, Cmp >::capacity(), Aleph::copy(), Aleph::DynLhashTable< Key, Record, Cmp >::insert(), HashStats< HashTbl >::set_lower_alpha(), HashStats< HashTbl >::set_upper_alpha(), and HashStats< HashTbl >::set_with_resize().
| TEST | ( | DynLhashTableConfiguration | , |
| UsesItsComparator | |||
| ) |
Definition at line 781 of file tpl_dynLhash_test.cc.
References Aleph::GenLhashTable< Key, BucketType, Cmp >::get_compare(), Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableCustomHash | , |
| WithCustomHashFunction | |||
| ) |
Definition at line 429 of file tpl_dynLhash_test.cc.
References custom_hash(), Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableDuplicates | , |
| InsertRefusesAKeyAlreadyThere | |||
| ) |
Definition at line 585 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::GenLhashTable< Key, BucketType, Cmp >::is_empty(), Aleph::DynLhashTable< Key, Record, Cmp >::remove(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), and Aleph::GenLhashTable< Key, BucketType, Cmp >::size().
| TEST | ( | DynLhashTableDuplicates | , |
| RefusedKeyLeavesTheSizeRight | |||
| ) |
Definition at line 608 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::remove(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), HashStats< HashTbl >::set_with_resize(), and Aleph::GenLhashTable< Key, BucketType, Cmp >::size().
| TEST | ( | DynLhashTableMoveValue | , |
| MoveInsert | |||
| ) |
Definition at line 267 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), and value.
| TEST | ( | DynLhashTableMoveValue | , |
| MoveKeyAndValue | |||
| ) |
Definition at line 278 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), and value.
| TEST | ( | DynLhashTablePostMove | , |
| MoveAssignmentTransfersOwnership | |||
| ) |
Definition at line 498 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTablePostMove | , |
| MoveConstructorTransfersOwnership | |||
| ) |
Definition at line 483 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStress | , |
| InterleavedInsertRemove | |||
| ) |
Definition at line 648 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), N, Aleph::DynLhashTable< Key, Record, Cmp >::remove(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStress | , |
| LargeScaleWithVerification | |||
| ) |
Definition at line 630 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), N, and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStress | , |
| ManyInsertions | |||
| ) |
Definition at line 293 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), N, and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStress | , |
| ManyInsertionsAndRemovals | |||
| ) |
Definition at line 305 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), N, Aleph::DynLhashTable< Key, Record, Cmp >::remove(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStress | , |
| RandomOperations | |||
| ) |
Definition at line 329 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::remove(), rng, and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStringKey | , |
| BasicOperations | |||
| ) |
Definition at line 221 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableStringKey | , |
| LongStrings | |||
| ) |
Definition at line 235 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST | ( | DynLhashTableSwap | , |
| SwapTables | |||
| ) |
Definition at line 444 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), and Aleph::DynLhashTable< Key, Record, Cmp >::swap().
| TEST | ( | DynLhashTableSwap | , |
| SwapWithEmpty | |||
| ) |
Definition at line 466 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), Aleph::DynLhashTable< Key, Record, Cmp >::search(), and Aleph::DynLhashTable< Key, Record, Cmp >::swap().
| TEST_F | ( | DynLhashTableTest | , |
| BracketOperatorInsert | |||
| ) |
Definition at line 116 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| BracketOperatorReadExisting | |||
| ) |
Definition at line 133 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| BracketOperatorReadNonExisting | |||
| ) |
Definition at line 141 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| BracketOperatorUpdate | |||
| ) |
Definition at line 125 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| CopyAssignment | |||
| ) |
Definition at line 170 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert(), and Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST_F | ( | DynLhashTableTest | , |
| CopyConstructor | |||
| ) |
Definition at line 155 of file tpl_dynLhash_test.cc.
References Aleph::copy().
| TEST_F | ( | DynLhashTableTest | , |
| EmptyTable | |||
| ) |
Definition at line 387 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| InsertAndSearch | |||
| ) |
Definition at line 59 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::insert().
| TEST_F | ( | DynLhashTableTest | , |
| InsertMultiple | |||
| ) |
Definition at line 79 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| IteratorSafety | |||
| ) |
Definition at line 694 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| MoveAssignment | |||
| ) |
Definition at line 196 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST_F | ( | DynLhashTableTest | , |
| MoveConstructor | |||
| ) |
Definition at line 185 of file tpl_dynLhash_test.cc.
References Aleph::DynLhashTable< Key, Record, Cmp >::search().
| TEST_F | ( | DynLhashTableTest | , |
| NegativeKeys | |||
| ) |
Definition at line 394 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| Remove | |||
| ) |
Definition at line 90 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| SameKeyMultipleInserts | |||
| ) |
Definition at line 405 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| SearchNonExistent | |||
| ) |
Definition at line 71 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| SelfAssignment | |||
| ) |
Definition at line 208 of file tpl_dynLhash_test.cc.
| TEST_F | ( | DynLhashTableTest | , |
| UpdateExisting | |||
| ) |
Definition at line 101 of file tpl_dynLhash_test.cc.