/trunk/Examples/test-suite/d/bools_runme.1.d
D | 20 lines | 15 code | 4 blank | 1 comment | 3 complexity | 38f04ca39d50c27949bb039c6ba1dd72 MD5 | raw file
1/// This is the bool runtime testcase. It checks that the C++ bool type works. 2module bools_runme; 3 4import bools.bools; 5 6void main() { 7 bool t = true; 8 bool f = false; 9 10 check_bo(f); 11 check_bo(t); 12} 13 14void check_bo(bool input) { 15 for (int i = 0; i < 1000; ++i) { 16 if (bo(input) != input) { 17 throw new Exception("Runtime test check_bo failed."); 18 } 19 } 20}