tb0130.pp 698 B

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