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

Items that enter a DynArrayHeap when memory runs out. More...

#include <gtest/gtest.h>
#include "allocation_failure.H"
#include <new>
#include <string>
#include <vector>
#include <tpl_dynArrayHeap.H>
Include dependency graph for dynarrayheap_allocation_test.cc:

Go to the source code of this file.

Functions

 TEST_F (DynArrayHeapWithoutMemory, InsertOfACopyLeavesTheHeapAsItWas)
 
 TEST_F (DynArrayHeapWithoutMemory, InsertOfAMoveLeavesTheHeapAsItWas)
 

Detailed Description

Items that enter a DynArrayHeap when memory runs out.

This program replaces the global operator new, so that a test can make one allocation fail. insert() counted the item before it made its place and copied it: without memory for either, the heap counted an item that it did not have.

Definition in file dynarrayheap_allocation_test.cc.

Function Documentation

◆ TEST_F() [1/2]

TEST_F ( DynArrayHeapWithoutMemory  ,
InsertOfACopyLeavesTheHeapAsItWas   
)

Definition at line 141 of file dynarrayheap_allocation_test.cc.

References h.

◆ TEST_F() [2/2]

TEST_F ( DynArrayHeapWithoutMemory  ,
InsertOfAMoveLeavesTheHeapAsItWas   
)

Definition at line 146 of file dynarrayheap_allocation_test.cc.

References h.