1
0
forked from 0ad/0ad
0ad/source/lib/self_test.cpp
janwas ed5041a301 some infrastructure for self-tests: gets rid of boilerplate code.
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.
2005-09-02 02:47:25 +00:00

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;
}