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

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

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)
 

Detailed Description

Tests for Memarray.

Definition in file memarray.cc.

Function Documentation

◆ is_power_of_two()

bool is_power_of_two ( size_t  x)

Definition at line 53 of file memarray.cc.

Referenced by TEST().

◆ TEST() [1/25]

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() [2/25]

TEST ( MemArray  ,
as_stack   
)

◆ TEST() [3/25]

◆ TEST() [4/25]

TEST ( MemArray  ,
boolean_relocation_reads_only_logical_initialized_elements   
)

◆ TEST() [5/25]

TEST ( MemArray  ,
call_operator_asserts_a_live_index_in_debug_builds   
)

◆ TEST() [6/25]

TEST ( MemArray  ,
copies_have_the_items_and_the_capacity_of_every_size   
)

Definition at line 1103 of file memarray.cc.

◆ TEST() [7/25]

TEST ( MemArray  ,
copying_and_moving_an_empty_moved_from_array   
)

◆ TEST() [8/25]

TEST ( MemArray  ,
failed_assignment_releases_temporary_storage_and_restores_annotations   
)

◆ TEST() [9/25]

TEST ( MemArray  ,
failed_copy_while_growing_leaves_the_array_unchanged   
)

◆ TEST() [10/25]

◆ TEST() [11/25]

TEST ( MemArray  ,
growth_inserts_at_any_position_of_a_sequence_from_any_slot   
)

Definition at line 1068 of file memarray.cc.

◆ TEST() [12/25]

TEST ( MemArray  ,
growth_of_a_trivially_copyable_struct_from_any_slot   
)

Definition at line 1117 of file memarray.cc.

◆ TEST() [13/25]

◆ TEST() [14/25]

◆ TEST() [15/25]

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() [16/25]

TEST ( MemArray  ,
push_of_own_element_inserts_its_value   
)

◆ TEST() [17/25]

TEST ( MemArray  ,
push_of_own_moved_element_inserts_its_value   
)

◆ TEST() [18/25]

TEST ( MemArray  ,
put_of_own_element_copies_it_before_growing   
)

◆ TEST() [19/25]

TEST ( MemArray  ,
put_of_own_moved_element_inserts_its_value   
)

◆ TEST() [20/25]

TEST ( MemArray  ,
putn_rejects_capacity_overflow   
)

Definition at line 493 of file memarray.cc.

References m.

◆ TEST() [21/25]

◆ TEST() [22/25]

TEST ( MemArray  ,
reverse_empty_and_single_item   
)

◆ TEST() [23/25]

TEST ( MemArray  ,
traverse_on_empty_container   
)

Definition at line 550 of file memarray.cc.

References m, and GenericTraverse< Container >::traverse().

◆ TEST() [24/25]

◆ TEST() [25/25]

TEST ( MemArrayMoveOnly  ,
AppendAndRemoveUniquePtr   
)

◆ TEST_F() [1/10]

◆ TEST_F() [2/10]

◆ TEST_F() [3/10]

◆ TEST_F() [4/10]

◆ TEST_F() [5/10]

◆ TEST_F() [6/10]

◆ TEST_F() [7/10]

TEST_F ( Default_MemArray  ,
remove_on_empty   
)

Definition at line 472 of file memarray.cc.

References m.

◆ TEST_F() [8/10]

◆ TEST_F() [9/10]

◆ TEST_F() [10/10]