/trunk/Examples/test-suite/d/bools_runme.2.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.
  2. module bools_runme;
  3. import bools.bools;
  4. void main() {
  5. bool t = true;
  6. bool f = false;
  7. check_bo(f);
  8. check_bo(t);
  9. }
  10. void check_bo(bool input) {
  11. for (int i = 0; i < 1000; ++i) {
  12. if (bo(input) != input) {
  13. throw new Exception("Runtime test check_bo failed.");
  14. }
  15. }
  16. }