import std.exception : assertNotThrown; import dchip.util : assertErrorsWith; int iteration = 10; int WARN_GJK_ITERATIONS = 10; version (CHIP_ENABLE_WARNINGS) { cpAssertSoft(iteration < WARN_GJK_ITERATIONS, "iteration < WARN_GJK_ITERATIONS") .assertErrorsWith(`Error: Requirement failed. Failed condition: "iteration < WARN_GJK_ITERATIONS".`); assertNotThrown!DChipError(cpAssertSoft(iteration == WARN_GJK_ITERATIONS, "iteration == WARN_GJK_ITERATIONS")); } else { assertNotThrown!DChipError(cpAssertSoft(iteration < WARN_GJK_ITERATIONS, "iteration < WARN_GJK_ITERATIONS")); }
If the CHIP_ENABLE_WARNINGS version is set, throw a DChipError if condition is false.