mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-07 17:40:07 +02:00
+ INitial implementation
This commit is contained in:
parent
9b4225f26f
commit
71ac75429e
27
bugs/bug0150.pp
Normal file
27
bugs/bug0150.pp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
programs bug0150;
|
||||||
|
{
|
||||||
|
bug to show that there is no assert() macro and directive
|
||||||
|
}
|
||||||
|
|
||||||
|
var B : boolean;
|
||||||
|
i : integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
b:=true;
|
||||||
|
i:=0;
|
||||||
|
// First for assert messages should not give anything.
|
||||||
|
// First two generate code, but are OK.
|
||||||
|
// second two don't generate code ($C- !)
|
||||||
|
{$c+}
|
||||||
|
assert (b);
|
||||||
|
assert (I=0);
|
||||||
|
{$c-}
|
||||||
|
assert (not(b));
|
||||||
|
assert (i<>0);
|
||||||
|
{$c+}
|
||||||
|
// This one should give the normal assert message.
|
||||||
|
assert (not(b));
|
||||||
|
// This one should give a custom assert message.
|
||||||
|
// you must uncomment the previous one to see this one.
|
||||||
|
assert (not(I=0),'Custom assert message');
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user