|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests for Memarray. More...
#include <gtest/gtest.h>#include <tpl_memArray.H>#include <htlist.H>#include <concepts>#include <limits>#include <memory>#include <new>#include <string>#include <type_traits>Go to the source code of this file.
Classes | |
| struct | Default_MemArray |
| struct | MemArray_with_30_items |
Functions | |
| bool | is_power_of_two (size_t x) |
| TEST (MemArray, Basic_initialization) | |
| TEST_F (Default_MemArray, growing_in_2_powers) | |
| TEST_F (Default_MemArray, putn) | |
| TEST (MemArrayMoveOnly, AppendAndRemoveUniquePtr) | |
| TEST_F (Default_MemArray, access_operator) | |
| TEST_F (Default_MemArray, reserve) | |
| TEST_F (MemArray_with_30_items, copy_and_assigment) | |
| TEST (MemArray, zero_capacity) | |
| TEST (MemArray, insertion_with_rvalues) | |
| TEST (MemArray, remove_with_rvalues) | |
| TEST_F (Default_MemArray, contraction) | |
| TEST_F (Default_MemArray, remove_on_empty) | |
| TEST (MemArray, reverse_empty_and_single_item) | |
| TEST (MemArray, putn_rejects_capacity_overflow) | |
| TEST (MemArray, as_stack) | |
| TEST (MemArray, Iterator_on_empty_container) | |
| TEST_F (Default_MemArray, Iterator) | |
| TEST (MemArray, traverse_on_empty_container) | |
| TEST_F (Default_MemArray, clear) | |
| TEST_F (Default_MemArray, traverse) | |
| TEST (MemArray, call_operator_asserts_a_live_index_in_debug_builds) | |
| TEST (MemArray, moved_from_storage_recovers_on_every_insertion_path) | |
| TEST (MemArray, copying_and_moving_an_empty_moved_from_array) | |
| TEST (MemArray, boolean_relocation_reads_only_logical_initialized_elements) | |
| TEST (MemArray, failed_assignment_releases_temporary_storage_and_restores_annotations) | |
| TEST (MemArray, put_of_own_element_copies_it_before_growing) | |
| TEST (MemArray, put_of_own_moved_element_inserts_its_value) | |
| TEST (MemArray, push_of_own_element_inserts_its_value) | |
| TEST (MemArray, push_of_own_moved_element_inserts_its_value) | |
| TEST (MemArray, failed_copy_while_growing_leaves_the_array_unchanged) | |
| TEST (MemArray, failed_growth_leaves_a_moved_argument_untouched) | |
| TEST (MemArray, growth_inserts_at_any_position_of_a_sequence_from_any_slot) | |
| TEST (MemArray, copies_have_the_items_and_the_capacity_of_every_size) | |
| TEST (MemArray, growth_of_a_trivially_copyable_struct_from_any_slot) | |
| TEST (MemArray, a_type_whose_assignment_is_not_trivial_is_copied_and_grown_through_it) | |
Tests for Memarray.
Definition in file memarray.cc.
| bool is_power_of_two | ( | size_t | x | ) |
Definition at line 53 of file memarray.cc.
Referenced by TEST().
| TEST | ( | MemArray | , |
| a_type_whose_assignment_is_not_trivial_is_copied_and_grown_through_it | |||
| ) |
Definition at line 1159 of file memarray.cc.
References Aleph::MemArray< T >::append(), Aleph::copy(), and value.
| TEST | ( | MemArray | , |
| as_stack | |||
| ) |
Definition at line 499 of file memarray.cc.
References OhashCommon< HashTbl, Key >::is_empty(), m, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | MemArray | , |
| Basic_initialization | |||
| ) |
Definition at line 74 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::get(), Aleph::MemArray< T >::is_empty(), is_power_of_two(), and Aleph::MemArray< T >::size().
| TEST | ( | MemArray | , |
| boolean_relocation_reads_only_logical_initialized_elements | |||
| ) |
Definition at line 770 of file memarray.cc.
References Aleph::MemArray< T >::get(), Aleph::MemArray< T >::put(), Aleph::MemArray< T >::putn(), Aleph::MemArray< T >::reserve(), and Aleph::MemArray< T >::size().
| TEST | ( | MemArray | , |
| call_operator_asserts_a_live_index_in_debug_builds | |||
| ) |
Definition at line 630 of file memarray.cc.
References Aleph::MemArray< T >::access(), Aleph::MemArray< T >::capacity(), and Aleph::MemArray< T >::put().
| TEST | ( | MemArray | , |
| copies_have_the_items_and_the_capacity_of_every_size | |||
| ) |
Definition at line 1103 of file memarray.cc.
| TEST | ( | MemArray | , |
| copying_and_moving_an_empty_moved_from_array | |||
| ) |
Definition at line 751 of file memarray.cc.
References Aleph::copy(), Aleph::MemArray< T >::is_empty(), and Aleph::MemArray< T >::put().
| TEST | ( | MemArray | , |
| failed_assignment_releases_temporary_storage_and_restores_annotations | |||
| ) |
Definition at line 822 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), Aleph::copy(), Aleph::MemArray< T >::get_ptr(), Aleph::MemArray< T >::put(), Aleph::MemArray< T >::putn(), Aleph::MemArray< T >::reserve(), Aleph::MemArray< T >::size(), and value.
| TEST | ( | MemArray | , |
| failed_copy_while_growing_leaves_the_array_unchanged | |||
| ) |
Definition at line 955 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::get_ptr(), Aleph::MemArray< T >::push(), Aleph::MemArray< T >::put(), Aleph::MemArray< T >::size(), and value.
| TEST | ( | MemArray | , |
| failed_growth_leaves_a_moved_argument_untouched | |||
| ) |
Definition at line 989 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), Failing_Slot::constructions_left, long_string(), Aleph::MemArray< T >::push(), Aleph::MemArray< T >::put(), Aleph::MemArray< T >::size(), value, and Failing_Slot::value.
| TEST | ( | MemArray | , |
| growth_inserts_at_any_position_of_a_sequence_from_any_slot | |||
| ) |
Definition at line 1068 of file memarray.cc.
| TEST | ( | MemArray | , |
| growth_of_a_trivially_copyable_struct_from_any_slot | |||
| ) |
Definition at line 1117 of file memarray.cc.
| TEST | ( | MemArray | , |
| insertion_with_rvalues | |||
| ) |
Definition at line 391 of file memarray.cc.
References Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), OhashCommon< HashTbl, Key >::insert(), OhashCommon< HashTbl, Key >::is_empty(), Aleph::HTList::is_empty(), k, l, m, N, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | MemArray | , |
| Iterator_on_empty_container | |||
| ) |
| TEST | ( | MemArray | , |
| moved_from_storage_recovers_on_every_insertion_path | |||
| ) |
Definition at line 718 of file memarray.cc.
References Aleph::has_curr(), and value.
| TEST | ( | MemArray | , |
| push_of_own_element_inserts_its_value | |||
| ) |
Definition at line 917 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::push(), Aleph::MemArray< T >::put(), and Aleph::MemArray< T >::size().
| TEST | ( | MemArray | , |
| push_of_own_moved_element_inserts_its_value | |||
| ) |
Definition at line 937 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), long_string(), Aleph::MemArray< T >::push(), Aleph::MemArray< T >::put(), and Aleph::MemArray< T >::size().
| TEST | ( | MemArray | , |
| put_of_own_element_copies_it_before_growing | |||
| ) |
Definition at line 884 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::put(), and Aleph::MemArray< T >::size().
| TEST | ( | MemArray | , |
| put_of_own_moved_element_inserts_its_value | |||
| ) |
Definition at line 901 of file memarray.cc.
References Aleph::MemArray< T >::capacity(), long_string(), Aleph::MemArray< T >::put(), and Aleph::MemArray< T >::size().
| TEST | ( | MemArray | , |
| putn_rejects_capacity_overflow | |||
| ) |
Definition at line 493 of file memarray.cc.
References m.
| TEST | ( | MemArray | , |
| remove_with_rvalues | |||
| ) |
Definition at line 419 of file memarray.cc.
References OhashCommon< HashTbl, Key >::capacity(), LocateFunctions< Container, Type >::get_it(), OhashCommon< HashTbl, Key >::insert(), Aleph::DynList< T >::insert(), OhashCommon< HashTbl, Key >::is_empty(), Aleph::HTList::is_empty(), k, l, m, and N.
| TEST | ( | MemArray | , |
| reverse_empty_and_single_item | |||
| ) |
Definition at line 481 of file memarray.cc.
References OhashCommon< HashTbl, Key >::append(), OhashCommon< HashTbl, Key >::is_empty(), m, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | MemArray | , |
| traverse_on_empty_container | |||
| ) |
Definition at line 550 of file memarray.cc.
References m, and GenericTraverse< Container >::traverse().
| TEST | ( | MemArray | , |
| zero_capacity | |||
| ) |
Definition at line 382 of file memarray.cc.
References OhashCommon< HashTbl, Key >::capacity(), OhashCommon< HashTbl, Key >::is_empty(), m, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | MemArrayMoveOnly | , |
| AppendAndRemoveUniquePtr | |||
| ) |
Definition at line 220 of file memarray.cc.
References OhashCommon< HashTbl, Key >::append(), OhashCommon< HashTbl, Key >::is_empty(), m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| access_operator | |||
| ) |
Definition at line 243 of file memarray.cc.
References OhashCommon< HashTbl, Key >::append(), OhashCommon< HashTbl, Key >::capacity(), OhashCommon< HashTbl, Key >::is_empty(), k, m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| clear | |||
| ) |
Definition at line 563 of file memarray.cc.
References OhashCommon< HashTbl, Key >::append(), OhashCommon< HashTbl, Key >::capacity(), OhashCommon< HashTbl, Key >::clear(), OhashCommon< HashTbl, Key >::is_empty(), m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| contraction | |||
| ) |
Definition at line 452 of file memarray.cc.
References Aleph::and, OhashCommon< HashTbl, Key >::append(), OhashCommon< HashTbl, Key >::capacity(), m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| growing_in_2_powers | |||
| ) |
Definition at line 139 of file memarray.cc.
References OhashCommon< HashTbl, Key >::append(), OhashCommon< HashTbl, Key >::capacity(), OhashCommon< HashTbl, Key >::insert(), k, m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| Iterator | |||
| ) |
Definition at line 537 of file memarray.cc.
References Aleph::Array_Iterator< T >::get_curr(), Aleph::Array_Iterator< T >::has_curr(), m, Aleph::Array_Iterator< T >::prev(), and Aleph::Array_Iterator< T >::reset_last().
| TEST_F | ( | Default_MemArray | , |
| putn | |||
| ) |
Definition at line 180 of file memarray.cc.
References OhashCommon< HashTbl, Key >::capacity(), dim(), OhashCommon< HashTbl, Key >::is_empty(), k, m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| remove_on_empty | |||
| ) |
Definition at line 472 of file memarray.cc.
References m.
| TEST_F | ( | Default_MemArray | , |
| reserve | |||
| ) |
Definition at line 294 of file memarray.cc.
References OhashCommon< HashTbl, Key >::capacity(), OhashCommon< HashTbl, Key >::is_empty(), m, and OhashCommon< HashTbl, Key >::size().
| TEST_F | ( | Default_MemArray | , |
| traverse | |||
| ) |
Definition at line 601 of file memarray.cc.
References OhashCommon< HashTbl, Key >::append(), m, N, OhashCommon< HashTbl, Key >::size(), and GenericTraverse< Container >::traverse().
| TEST_F | ( | MemArray_with_30_items | , |
| copy_and_assigment | |||
| ) |
Definition at line 305 of file memarray.cc.
References OhashCommon< HashTbl, Key >::capacity(), Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::get_ptr(), OhashCommon< HashTbl, Key >::is_empty(), Aleph::MemArray< T >::is_empty(), k, m, OhashCommon< HashTbl, Key >::size(), Aleph::MemArray< T >::size(), and Aleph::ODhashTable< Key, Cmp >::swap().