tb0130.pp 682 B

1234567891011121314151617181920212223242526272829
  1. { Old file: tbs0150.pp }
  2. { Shows that the assert() macro is missing under Delphi OK 0.99.9 (PFV) }
  3. {
  4. bug to show that there is no assert() macro and directive
  5. }
  6. var B : boolean;
  7. i : integer;
  8. begin
  9. b:=true;
  10. i:=0;
  11. // First for assert messages should not give anything.
  12. // First two generate code, but are OK.
  13. // second two don't generate code ($C- !)
  14. {$c+}
  15. assert (b);
  16. assert (I=0);
  17. {$c-}
  18. assert (not(b));
  19. assert (i<>0);
  20. {$c+}
  21. // This one should give the normal assert message.
  22. assert (not(b));
  23. // This one should give a custom assert message.
  24. // you must uncomment the previous one to see this one.
  25. assert (not(I=0),'Custom assert message');
  26. end.