PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  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. }