|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
An insertion into a Gen_BPlus_Tree that fails for lack of memory leaves the tree as it was. More...
#include <gtest/gtest.h>#include "allocation_failure.H"#include <new>#include <string>#include <tpl_bplus_tree.H>Go to the source code of this file.
Classes | |
| struct | BPlusTreeWithoutMemory |
Functions | |
| TEST_F (BPlusTreeWithoutMemory, SplitOfAFullRoot) | |
| TEST_F (BPlusTreeWithoutMemory, SplitsBelowTheRoot) | |
| TEST_F (BPlusTreeWithoutMemory, KeysWhoseCopiesAllocate) | |
An insertion into a Gen_BPlus_Tree that fails for lack of memory leaves the tree as it was.
Each test makes the n-th allocation of one insert() fail, for every n until the insert no longer allocates that many times, and then checks the tree. split_child() truncated the full child before allocating the new node and the separators, so a failure lost the keys of the new node, and the whole tree when insert() split a full root; and the separators that insert_nonfull() rebuilt on the way back were lost when one of their copies failed.
Definition in file bplus_allocation_failure_test.cc.
| TEST_F | ( | BPlusTreeWithoutMemory | , |
| KeysWhoseCopiesAllocate | |||
| ) |
Definition at line 135 of file bplus_allocation_failure_test.cc.
| TEST_F | ( | BPlusTreeWithoutMemory | , |
| SplitOfAFullRoot | |||
| ) |
Definition at line 121 of file bplus_allocation_failure_test.cc.
| TEST_F | ( | BPlusTreeWithoutMemory | , |
| SplitsBelowTheRoot | |||
| ) |
Definition at line 128 of file bplus_allocation_failure_test.cc.