1 import std.exception : assertNotThrown; 2 import dchip.util : assertErrorsWith; 3 4 int iteration = 10; 5 int WARN_GJK_ITERATIONS = 10; 6 7 version (CHIP_ENABLE_WARNINGS) 8 { 9 cpAssertSoft(iteration < WARN_GJK_ITERATIONS, "iteration < WARN_GJK_ITERATIONS") 10 .assertErrorsWith(`Error: Requirement failed. Failed condition: "iteration < WARN_GJK_ITERATIONS".`); 11 12 assertNotThrown!DChipError(cpAssertSoft(iteration == WARN_GJK_ITERATIONS, 13 "iteration == WARN_GJK_ITERATIONS")); 14 } 15 else 16 { 17 assertNotThrown!DChipError(cpAssertSoft(iteration < WARN_GJK_ITERATIONS, 18 "iteration < WARN_GJK_ITERATIONS")); 19 }
If the CHIP_ENABLE_WARNINGS version is set, throw a DChipError if condition is false.