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

What a container declares noexcept does not allocate. More...

#include <gtest/gtest.h>
#include "allocation_failure.H"
#include <ah-mapping.H>
#include <bitArray.H>
#include <htlist.H>
#include <tpl_array.H>
#include <tpl_arrayHeap.H>
#include <tpl_arrayQueue.H>
#include <tpl_arrayStack.H>
#include <tpl_avl.H>
#include <tpl_avlRk.H>
#include <tpl_binTree.H>
#include <tpl_dynArray.H>
#include <tpl_dynArrayHeap.H>
#include <tpl_dynBinHeap.H>
#include <tpl_dynDlist.H>
#include <tpl_dynLhash.H>
#include <tpl_dynListQueue.H>
#include <tpl_dynListStack.H>
#include <tpl_dynMapOhash.H>
#include <tpl_dynMapTree.H>
#include <tpl_dynMat.H>
#include <tpl_dynSetHash.H>
#include <tpl_dynSetTree.H>
#include <tpl_dynSkipList.H>
#include <tpl_flat_map.H>
#include <tpl_flat_set.H>
#include <tpl_graph.H>
#include <tpl_hRbTree.H>
#include <tpl_hRbTreeRk.H>
#include <tpl_hash.H>
#include <tpl_memArray.H>
#include <tpl_multi_polynomial.H>
#include <tpl_odhash.H>
#include <tpl_olhash.H>
#include <tpl_rand_tree.H>
#include <tpl_random_queue.H>
#include <tpl_rb_tree.H>
#include <tpl_rbRk.H>
#include <tpl_small_vector.H>
#include <tpl_splay_tree.H>
#include <tpl_splay_treeRk.H>
#include <tpl_tdRbTree.H>
#include <tpl_tdRbTreeRk.H>
#include <tpl_treap.H>
#include <tpl_treapRk.H>
#include <array>
#include <cstddef>
#include <cstdlib>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
Include dependency graph for noexcept_allocation_test.cc:

Go to the source code of this file.

Classes

struct  NoexceptAllocation
 

Macros

#define TEST_UNDER_A_SANITIZER   0
 
#define TEST_SEES_THE_HEAP   0
 
#define CHECK(Container, how)
 
#define CHECK_FIXED(Container, how)
 
#define CHECK(Tree)
 
#define CHECK_SET(Set, out)
 
#define CHECK_MAP(Map, out)
 

Functions

 TEST_F (NoexceptAllocation, TheItemAllocatesWhenItIsBuiltByDefaultAndNotWhenItMoves)
 
 TEST_F (NoexceptAllocation, TheItemWithoutMoveAllocatesWhenItIsMoved)
 
 TEST_F (NoexceptAllocation, Sequences)
 
 TEST_F (NoexceptAllocation, SetsAndMapsOnTrees)
 
 TEST_F (NoexceptAllocation, TheMovesOfTheSetsOnTreesThatAreChecked)
 
 TEST_F (NoexceptAllocation, SetsAndMapsOnHashTables)
 
 TEST_F (NoexceptAllocation, TheMovesOfTheLinearTablesAndOfTheRandomSetThatAreChecked)
 
 TEST_F (NoexceptAllocation, AMapThatTookAnotherHashFunctionMovesWithoutAllocating)
 
 TEST_F (NoexceptAllocation, AMoveAssignmentOfATableOfChainedListsCopiesNoHashFunction)
 
 TEST_F (NoexceptAllocation, Graphs)
 
 TEST_F (NoexceptAllocation, WhatKeepsADynArrayTakesNoMemoryUntilItWrites)
 

Detailed Description

What a container declares noexcept does not allocate.

Definition in file noexcept_allocation_test.cc.

Macro Definition Documentation

◆ CHECK [1/2]

#define CHECK (   Container,
  how 
)
Value:
expect_that_what_is_noexcept_does_not_allocate<Container<T>> \
(name(#Container).c_str(), w.how)
long double w
Definition btreepic.C:153

◆ CHECK [2/2]

#define CHECK (   Tree)
Value:
expect_that_what_is_noexcept_does_not_allocate<DynSetTree<T, Tree>> \
(name(#Tree).c_str(), w.insert); \
expect_that_what_is_noexcept_does_not_allocate<DynMapTree<int, T, Tree>> \
(("DynMapTree<int, " + of + ", " #Tree ">").c_str(), w.insert_value)
QuadTree - Hierarchical spatial index for 2D points.
Definition quadtree.H:126

◆ CHECK_FIXED

#define CHECK_FIXED (   Container,
  how 
)
Value:
expect_that_what_is_noexcept_does_not_allocate<Container<T>> \
(name(#Container).c_str(), w.how, its_use_after_a_move)

◆ CHECK_MAP

#define CHECK_MAP (   Map,
  out 
)
Value:
expect_that_what_is_noexcept_does_not_allocate<Map<int, T>> \
((std::string(#Map "<int, ") + of + ">").c_str(), w.insert_value, out);\
expect_that_what_is_noexcept_does_not_allocate<Map<T, int>> \
((std::string(#Map "<") + of + ", int>").c_str(), w.insert_key, out)
size_t size_t int32_t * out
Definition ca-c-api.h:120

◆ CHECK_SET

#define CHECK_SET (   Set,
  out 
)
Value:
expect_that_what_is_noexcept_does_not_allocate<Set<T>> \
((std::string(#Set "<") + of + ">").c_str(), w.insert, out)

◆ TEST_SEES_THE_HEAP

#define TEST_SEES_THE_HEAP   0

Definition at line 137 of file noexcept_allocation_test.cc.

◆ TEST_UNDER_A_SANITIZER

#define TEST_UNDER_A_SANITIZER   0

Definition at line 134 of file noexcept_allocation_test.cc.

Function Documentation

◆ TEST_F() [1/11]

TEST_F ( NoexceptAllocation  ,
AMapThatTookAnotherHashFunctionMovesWithoutAllocating   
)

◆ TEST_F() [2/11]

◆ TEST_F() [3/11]

TEST_F ( NoexceptAllocation  ,
Graphs   
)

Definition at line 665 of file noexcept_allocation_test.cc.

References w.

◆ TEST_F() [4/11]

TEST_F ( NoexceptAllocation  ,
Sequences   
)

Definition at line 517 of file noexcept_allocation_test.cc.

References Aleph::BitArray::push().

◆ TEST_F() [5/11]

TEST_F ( NoexceptAllocation  ,
SetsAndMapsOnHashTables   
)

Definition at line 565 of file noexcept_allocation_test.cc.

◆ TEST_F() [6/11]

TEST_F ( NoexceptAllocation  ,
SetsAndMapsOnTrees   
)

Definition at line 526 of file noexcept_allocation_test.cc.

◆ TEST_F() [7/11]

TEST_F ( NoexceptAllocation  ,
TheItemAllocatesWhenItIsBuiltByDefaultAndNotWhenItMoves   
)

Definition at line 483 of file noexcept_allocation_test.cc.

◆ TEST_F() [8/11]

TEST_F ( NoexceptAllocation  ,
TheItemWithoutMoveAllocatesWhenItIsMoved   
)

Definition at line 500 of file noexcept_allocation_test.cc.

◆ TEST_F() [9/11]

TEST_F ( NoexceptAllocation  ,
TheMovesOfTheLinearTablesAndOfTheRandomSetThatAreChecked   
)

Definition at line 579 of file noexcept_allocation_test.cc.

◆ TEST_F() [10/11]

TEST_F ( NoexceptAllocation  ,
TheMovesOfTheSetsOnTreesThatAreChecked   
)

Definition at line 547 of file noexcept_allocation_test.cc.

◆ TEST_F() [11/11]

TEST_F ( NoexceptAllocation  ,
WhatKeepsADynArrayTakesNoMemoryUntilItWrites   
)