quakeforge/libs/util/test/Makemodule.am
Bill Currie 0ebb0717b0 [zone] Add failing test cases
The tests fail as they exercise how the cache *SHOULD* work rather than
how it does now.

The tests do currently pass for the pending work I've done on the cache
system, but while working on it, I remembered why I reworked cache
allocation...

The essential problem is that sounds are loaded into the cache, which is
fine for synchronous output targets, but has proven to be a minefield
for asynchronous output targets (JACK, ALSA).

The reason for the minefield is the hunk takes priority over the cache,
and is free to move cache blocks around, and *even dispose of them
entirely* in order to satisfy memory allocations from either end of the
hunk. Doing this in an entirely single-threaded process (as DOS Quake
was) is perfectly safe, as the users of the cache just reload the
pointer each time, and bail if it's null (meaning the block has been
freed), or even cause the data to be reloaded if possible (I'm a little
fuzzy on the details for that as I didn't write that code). However, in
multi-threaded code, especially real-time (JACK, possibly ALSA), it's a
recipe for disaster. The 4cab5b90e6 commit was a (mostly) successful
attempt to mitigate the problem by allocating the cache blocks from the
high-hunk (thus minimizing any movement caused by low-hunk allocations),
it resulted in cache allocates and regular high-hunk allocations somehow
getting intertwined: while investigating just how much memory ad_tears
needs (somewhere between 192MB and 256MB), I got "trashed sentinel"
errors and upon investigation, I found what looks very suspiciously like
audio data written across a hunk control block.

I've decided that the cache allocation *algorithm* should be reverted to
how it was originally designed by Id (details will remain "modern"), but
while working on the tests, I remembered why I had done the changes in
the first place (above story). Thus the work on reverting the cache
allocation can't go in until I get sound memory management independent
of the cache. The tests are going in now so I have a constant reminder :)
2022-06-03 12:52:59 +09:00

135 lines
5.3 KiB
Text

libs_util_tests = \
libs/util/test/test-bary \
libs/util/test/test-baryvf \
libs/util/test/test-bitop \
libs/util/test/test-bsearch \
libs/util/test/test-cexpr \
libs/util/test/test-cmem \
libs/util/test/test-cs \
libs/util/test/test-csvf \
libs/util/test/test-darray \
libs/util/test/test-dq \
libs/util/test/test-half \
libs/util/test/test-heapsort \
libs/util/test/test-listener \
libs/util/test/test-mat3 \
libs/util/test/test-mat4 \
libs/util/test/test-plist \
libs/util/test/test-pqueue \
libs/util/test/test-qfs \
libs/util/test/test-quat \
libs/util/test/test-seb \
libs/util/test/test-sebvf \
libs/util/test/test-seg \
libs/util/test/test-set \
libs/util/test/test-simd \
libs/util/test/test-utf8 \
libs/util/test/test-zone
TESTS += $(libs_util_tests)
check_PROGRAMS += $(libs_util_tests)
libs_util_test_test_bary_SOURCES=libs/util/test/test-bary.c
libs_util_test_test_bary_LDADD=libs/util/libQFutil.la
libs_util_test_test_bary_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_baryvf_SOURCES=libs/util/test/test-baryvf.c
libs_util_test_test_baryvf_LDADD=libs/util/libQFutil.la
libs_util_test_test_baryvf_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_bitop_SOURCES=libs/util/test/test-bitop.c
libs_util_test_test_bitop_LDADD=libs/util/libQFutil.la
libs_util_test_test_bitop_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_bsearch_SOURCES=libs/util/test/test-bsearch.c
libs_util_test_test_bsearch_LDADD=libs/util/libQFutil.la
libs_util_test_test_bsearch_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_cexpr_SOURCES=libs/util/test/test-cexpr.c
libs_util_test_test_cexpr_LDADD=libs/util/libQFutil.la
libs_util_test_test_cexpr_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_cmem_SOURCES=libs/util/test/test-cmem.c
libs_util_test_test_cmem_LDADD=libs/util/libQFutil.la
libs_util_test_test_cmem_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_cs_SOURCES=libs/util/test/test-cs.c
libs_util_test_test_cs_LDADD=libs/util/libQFutil.la
libs_util_test_test_cs_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_csvf_SOURCES=libs/util/test/test-csvf.c
libs_util_test_test_csvf_LDADD=libs/util/libQFutil.la
libs_util_test_test_csvf_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_darray_SOURCES=libs/util/test/test-darray.c
libs_util_test_test_darray_LDADD=libs/util/libQFutil.la
libs_util_test_test_darray_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_dq_SOURCES=libs/util/test/test-dq.c
libs_util_test_test_dq_LDADD=libs/util/libQFutil.la
libs_util_test_test_dq_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_half_SOURCES=libs/util/test/test-half.c
libs_util_test_test_half_LDADD=libs/util/libQFutil.la
libs_util_test_test_half_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_heapsort_SOURCES=libs/util/test/test-heapsort.c
libs_util_test_test_heapsort_LDADD=libs/util/libQFutil.la
libs_util_test_test_heapsort_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_listener_SOURCES=libs/util/test/test-listener.c
libs_util_test_test_listener_LDADD=libs/util/libQFutil.la
libs_util_test_test_listener_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_mat3_SOURCES=libs/util/test/test-mat3.c
libs_util_test_test_mat3_LDADD=libs/util/libQFutil.la
libs_util_test_test_mat3_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_mat4_SOURCES=libs/util/test/test-mat4.c
libs_util_test_test_mat4_LDADD=libs/util/libQFutil.la
libs_util_test_test_mat4_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_plist_SOURCES=libs/util/test/test-plist.c
libs_util_test_test_plist_LDADD=libs/util/libQFutil.la
libs_util_test_test_plist_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_pqueue_SOURCES=libs/util/test/test-pqueue.c
libs_util_test_test_pqueue_LDADD=libs/util/libQFutil.la
libs_util_test_test_pqueue_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_qfs_SOURCES=libs/util/test/test-qfs.c
libs_util_test_test_qfs_LDADD=libs/util/libQFutil.la
libs_util_test_test_qfs_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_quat_SOURCES=libs/util/test/test-quat.c
libs_util_test_test_quat_LDADD=libs/util/libQFutil.la
libs_util_test_test_quat_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_seb_SOURCES=libs/util/test/test-seb.c
libs_util_test_test_seb_LDADD=libs/util/libQFutil.la
libs_util_test_test_seb_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_sebvf_SOURCES=libs/util/test/test-sebvf.c
libs_util_test_test_sebvf_LDADD=libs/util/libQFutil.la
libs_util_test_test_sebvf_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_seg_SOURCES=libs/util/test/test-seg.c
libs_util_test_test_seg_LDADD=libs/util/libQFutil.la
libs_util_test_test_seg_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_set_SOURCES=libs/util/test/test-set.c
libs_util_test_test_set_LDADD=libs/util/libQFutil.la
libs_util_test_test_set_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_simd_SOURCES=libs/util/test/test-simd.c
libs_util_test_test_simd_LDADD=libs/util/libQFutil.la
libs_util_test_test_simd_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_utf8_SOURCES=libs/util/test/test-utf8.c
libs_util_test_test_utf8_LDADD=libs/util/libQFutil.la
libs_util_test_test_utf8_DEPENDENCIES=libs/util/libQFutil.la
libs_util_test_test_zone_SOURCES=libs/util/test/test-zone.c
libs_util_test_test_zone_LDADD=libs/util/libQFutil.la
libs_util_test_test_zone_DEPENDENCIES=libs/util/libQFutil.la