Skip to content

Add Testing for when Allocating More Buffer Space Fails #717

@InsertCreativityHere

Description

@InsertCreativityHere

Some of the underlying buffers we use will dynamically grow themselves as needed.
In the incredibly rare case they fail to allocate (or have more than isize::MAX elements), this allocation function returns an error.

However, there is no practical way to test this with the built in Global allocator.
Instead, we should create our own mock allocator, which just always fails to allocate. And use this for the tests I'm describing.

Unfortunately, the Allocator API is not available on stable Rust yet. So we have no way to mock it yet.
See rust-lang/rust#32838

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting on upstreamThis Issue is on hold, waiting on some upstream dependencyslice-codecRelated to the 'slice-codec' cratetestingAdding or modifying tests

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions