util: Add a randomized test for the virtual memory allocator
authorScott D Phillips <scott.d.phillips@intel.com>
Sat, 5 May 2018 00:11:13 +0000 (17:11 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 31 May 2018 23:51:35 +0000 (16:51 -0700)
commit943fecc5691b55b8ce8740d133dd70614effb72d
treeaa5bd576ca6fb71554e742460c69e90a86588a17
parentf19ad5d31fde8c447119c5483b3e3972922e9991
util: Add a randomized test for the virtual memory allocator

The test pseudo-randomly makes allocations and deallocations with
the virtual memory allocator and checks that the results are
consistent. Specifically, we test that:

 * no result from the allocator overlaps an already allocated range
 * allocated memory fulfills the stated alignment requirement
 * a failed result from the allocator could not have been fulfilled
 * memory freed to the allocator can later be allocated again

v2: - fix if() in test() to actually run fill()
v3: - add c++11 build flag (Jason)
    - test the full 64-bit range (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
configure.ac
src/util/Makefile.am
src/util/meson.build
src/util/tests/vma/Makefile.am [new file with mode: 0644]
src/util/tests/vma/meson.build [new file with mode: 0644]
src/util/tests/vma/vma_random_test.cpp [new file with mode: 0644]