Add unit tests for some surgeries, adds more APIs for unit tests to call (#52093)

* Add unit tests for medical related stuff

* Remove inaccurate assertion
This commit is contained in:
Jared-Fogle
2020-07-09 13:41:59 -04:00
committed by GitHub
parent 7b9a8dbf4b
commit 4b21913c58
4 changed files with 107 additions and 0 deletions
+12
View File
@@ -2,6 +2,14 @@
//Keep this sorted alphabetically
#ifdef UNIT_TESTS
/// Asserts that a condition is true
/// If the condition is not true, fails the test
#define TEST_ASSERT(assertion, reason) if (!(assertion)) { return Fail("Assertion failed: [reason || "No reason"]") }
/// Asserts that the two parameters passed are equal, fails otherwise
/// Optionally allows an additional message in the case of a failure
#define TEST_ASSERT_EQUAL(a, b, message) if ((a) != (b)) { return Fail("Expected [a] to be equal to [b].[message ? " [message]" : ""]") }
#include "anchored_mobs.dm"
#include "bespoke_id.dm"
#include "card_mismatch.dm"
@@ -13,6 +21,10 @@
#include "spawn_humans.dm"
#include "species_whitelists.dm"
#include "subsystem_init.dm"
#include "surgeries.dm"
#include "timer_sanity.dm"
#include "unit_test.dm"
#undef TEST_ASSERT
#undef TEST_ASSERT_EQUAL
#endif