C/C++ API Reference
Loading...
Searching...
No Matches
Testing and debugging

Oveview

Test utilities for allocator implementers.

These facilitate writing unit tests and fuzz tests for both concrete and forwarding allocator implementations. They are not intended to be used by module consumers.

Submodules

 FuzzTest support
 

Classes

class  pw::allocator::test::FaultInjectingAllocator
 
struct  pw::allocator::test::AllocationRequest
 Represents a request to allocate some memory. More...
 
struct  pw::allocator::test::DeallocationRequest
 Represents a request to free some allocated memory. More...
 
struct  pw::allocator::test::ReallocationRequest
 Represents a request to reallocate allocated memory with a new size. More...
 
class  pw::allocator::test::TestHarness
 
class  pw::allocator::test::AllocatorForTest< kBufferSize, BlockType_, MetricsType >
 An AllocatorForTest that is automatically initialized on construction. More...
 

Typedefs

using pw::allocator::test::Request = std::variant< AllocationRequest, DeallocationRequest, ReallocationRequest >
 

Functions

size_t pw::allocator::test::AlignmentFromLShift (size_t lshift, size_t size)
 
template<typename BlockType >
void pw::allocator::test::FreeAll (typename BlockType::Range range)
 Free all the blocks reachable by the given block. Useful for test cleanup.
 

Variables

constexpr pw::tokenizer::Token pw::allocator::test::kToken = PW_TOKENIZE_STRING("test")
 

Function Documentation

◆ AlignmentFromLShift()

size_t pw::allocator::test::AlignmentFromLShift ( size_t  lshift,
size_t  size 
)

Helper function to produce a valid alignment for a given size from an arbitrary left shift amount.