Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

jbboehr/covmalloc

Repository files navigation

covmalloc

Build Status

Allows you to cause malloc to fail.

Installation

Ubuntu

git clone git://github.com/jbboehr/covmalloc.git
cd covmalloc
./configure && make install

Usage

You'll need to link the module to use covmalloc_failure, and you'll also need to run your tests using LD_PRELOAD. For example, with automake:

TESTS_ENVIRONMENT += LD_PRELOAD=@LIBCOVMALLOC_DIR@/libcovmalloc.so
AM_LDFLAGS = @COVMALLOC_LIBS@

Example:

int * a, int * b, int * c;
a = malloc(sizeof(int)); // ok
covmalloc_failure(1);
b = malloc(sizeof(int)); // NULL
covmalloc_failure(0);
c = malloc(sizeof(int)); // ok

License

This project is licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published