/trunk/Examples/test-suite/d/bools_runme.2.d
D | 20 lines | 15 code | 4 blank | 1 comment | 3 complexity | 38f04ca39d50c27949bb039c6ba1dd72 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- /// This is the bool runtime testcase. It checks that the C++ bool type works.
- module bools_runme;
- import bools.bools;
- void main() {
- bool t = true;
- bool f = false;
- check_bo(f);
- check_bo(t);
- }
- void check_bo(bool input) {
- for (int i = 0; i < 1000; ++i) {
- if (bo(input) != input) {
- throw new Exception("Runtime test check_bo failed.");
- }
- }
- }