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

Extractions from a Fibonacci heap when memory runs out. More...

#include <gtest/gtest.h>
#include "allocation_failure.H"
#include <cstdlib>
#include <new>
#include <numeric>
#include <utility>
#include <vector>
#include <tpl_fibonacci_heap.H>
#include <tpl_graph.H>
#include <archeap.H>
Include dependency graph for fibonacci_heap_allocation_test.cc:

Go to the source code of this file.

Classes

struct  FibonacciHeapWithoutMemory
 

Functions

 TEST_F (FibonacciHeapWithoutMemory, AHeapIsBuiltWithoutMemory)
 
 TEST_F (FibonacciHeapWithoutMemory, AnArcHeapKeepsItsHandlesWithoutMemory)
 
 TEST_F (FibonacciHeapWithoutMemory, ExtractAndDeleteAllocateNothing)
 
 TEST_F (FibonacciHeapWithoutMemory, AHeapMovedFromIsAsItWasWithoutMemory)
 

Detailed Description

Extractions from a Fibonacci heap when memory runs out.

This program replaces the global operator new, so that a test can make every allocation fail for a while. A heap is built without allocating. extract_min() and delete_node() must allocate nothing, but the room that a new heap, or one that was moved from, lacks; they allocate it before they change the heap, so that without memory the heap is as it was.

Definition in file fibonacci_heap_allocation_test.cc.

Function Documentation

◆ TEST_F() [1/4]

TEST_F ( FibonacciHeapWithoutMemory  ,
AHeapIsBuiltWithoutMemory   
)

Definition at line 71 of file fibonacci_heap_allocation_test.cc.

◆ TEST_F() [2/4]

TEST_F ( FibonacciHeapWithoutMemory  ,
AHeapMovedFromIsAsItWasWithoutMemory   
)

◆ TEST_F() [3/4]

◆ TEST_F() [4/4]

TEST_F ( FibonacciHeapWithoutMemory  ,
ExtractAndDeleteAllocateNothing   
)

Definition at line 161 of file fibonacci_heap_allocation_test.cc.

References k.