summaryrefslogtreecommitdiffstats
path: root/test/src/test.c
Commit message (Collapse)AuthorAgeFilesLines
* Add basic reentrancy-checking support, and allow arena_new to reenter.David Goldblatt2017-04-071-24/+52
| | | | | | | | | This checks whether or not we're reentrant using thread-local data, and, if we are, moves certain internal allocations to use arena 0 (which should be properly initialized after bootstrapping). The immediate thing this allows is spinning up threads in arena_new, which will enable spinning up background threads there.
* Add hooking functionalityDavid Goldblatt2017-04-071-4/+72
| | | | | This allows us to hook chosen functions and do interesting things there (in particular: reentrancy checking).
* Remove extraneous parens around return arguments.Jason Evans2017-01-211-4/+4
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-211-19/+11
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Remove leading blank lines from function bodies.Jason Evans2017-01-131-4/+0
| | | | This resolves #535.
* Fix tsd bootstrapping for a0malloc().Jason Evans2016-05-071-15/+41
|
* Add JEMALLOC_FORMAT_PRINTF().Jason Evans2015-07-221-2/+2
| | | | | | Replace JEMALLOC_ATTR(format(printf, ...). with JEMALLOC_FORMAT_PRINTF(), so that configuration feature tests can omit the attribute if it would cause extraneous compilation warnings.
* Use nallocx() rather than mallctl() to trigger initialization.Jason Evans2014-05-281-1/+1
| | | | | | Use nallocx() rather than mallctl() to trigger initialization, because nallocx() has no side effects other than initialization, whereas mallctl() does a bunch of internal memory allocation.
* Make sure initialization occurs prior to running tests.Jason Evans2014-05-281-1/+14
|
* Fix coding sytle nits.Jason Evans2014-05-011-2/+2
|
* Fix p_test_fail()'s va_list abuse.Jason Evans2014-03-301-8/+2
| | | | | | | | | p_test_fail() was passing a va_list to two separate functions with the expectation that no reset would occur. Refactor p_test_fail()'s callers to instead format two strings and pass them to p_test_fail(). Add a missing parameter to an assert_u64_eq() call, which the compiler warned about after the assertion macro refactoring.
* Add zero/align tests for rallocx().Jason Evans2013-12-151-0/+2
|
* Streamline test output.Jason Evans2013-12-121-5/+7
|
* Refactor tests.Jason Evans2013-12-091-6/+74
| | | | | | | Refactor tests to use explicit testing assertions, rather than diff'ing test output. This makes the test code a bit shorter, more explicitly encodes testing intent, and makes test failure diagnosis more straightforward.
* Refactor to support more varied testing.Jason Evans2013-12-041-0/+28
Refactor the test harness to support three types of tests: - unit: White box unit tests. These tests have full access to all internal jemalloc library symbols. Though in actuality all symbols are prefixed by jet_, macro-based name mangling abstracts this away from test code. - integration: Black box integration tests. These tests link with the installable shared jemalloc library, and with the exception of some utility code and configure-generated macro definitions, they have no access to jemalloc internals. - stress: Black box stress tests. These tests link with the installable shared jemalloc library, as well as with an internal allocator with symbols prefixed by jet_ (same as for unit tests) that can be used to allocate data structures that are internal to the test code. Move existing tests into test/{unit,integration}/ as appropriate. Split out internal parts of jemalloc_defs.h.in and put them in jemalloc_internal_defs.h.in. This reduces internals exposure to applications that #include <jemalloc/jemalloc.h>. Refactor jemalloc.h header generation so that a single header file results, and the prototypes can be used to generate jet_ prototypes for tests. Split jemalloc.h.in into multiple parts (jemalloc_defs.h.in, jemalloc_macros.h.in, jemalloc_protos.h.in, jemalloc_mangle.h.in) and use a shell script to generate a unified jemalloc.h at configure time. Change the default private namespace prefix from "" to "je_". Add missing private namespace mangling. Remove hard-coded private_namespace.h. Instead generate it and private_unnamespace.h from private_symbols.txt. Use similar logic for public symbols, which aids in name mangling for jet_ symbols. Add test_warn() and test_fail(). Replace existing exit(1) calls with test_fail() calls.