forked from 0ad/0ad
janwas
ed5041a301
squelch debug asserts during self-tests to avoid warning about intended errors (passing invalid data into functions to test their error reporting) This was SVN commit r2646.
16 lines
349 B
C++
16 lines
349 B
C++
#include "precompiled.h"
|
|
|
|
#include "self_test.h"
|
|
|
|
// if true, debug_assert does nothing.
|
|
bool self_test_active = false;
|
|
|
|
// trampoline that sets self_test_active and returns a dummy value;
|
|
// used by RUN_SELF_TEST.
|
|
int run_self_test(void(*test_func)())
|
|
{
|
|
self_test_active = true;
|
|
test_func();
|
|
self_test_active = false;
|
|
return 0;
|
|
} |