mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 20:19:25 +02:00
+ test for four char codes
git-svn-id: trunk@442 -
This commit is contained in:
parent
7356f83713
commit
c92377604c
@ -7,6 +7,11 @@ program tmacpas2;
|
||||
var
|
||||
success: Boolean = true;
|
||||
|
||||
type
|
||||
{Since we do not want to compile in the whole mac api, we
|
||||
simulate decl of FourCharCode here:}
|
||||
|
||||
MyFourCharCodeType = Longword;
|
||||
|
||||
procedure Proc;
|
||||
|
||||
@ -15,16 +20,27 @@ begin
|
||||
Exit(Proc);
|
||||
end;
|
||||
|
||||
const
|
||||
a = true;
|
||||
b = true;
|
||||
c = false;
|
||||
procedure TestFourCharCode(myFCC: MyFourCharCodeType);
|
||||
|
||||
begin
|
||||
Writeln('FPC creator code as number: ', myFCC);
|
||||
if myFCC <> $46506173 then
|
||||
success := false;
|
||||
end;
|
||||
|
||||
const
|
||||
myFCCconst = 'FPas'; {Free Pascals Creator code :) }
|
||||
|
||||
var
|
||||
p: pointer;
|
||||
l,i: longint;
|
||||
a,b,c : Boolean;
|
||||
|
||||
begin
|
||||
a := true;
|
||||
b := true;
|
||||
c := false;
|
||||
|
||||
{** Test & and | as alias for AND and OR **}
|
||||
if not (a & b) then
|
||||
success:= false;
|
||||
@ -37,6 +53,7 @@ begin
|
||||
if l <> 4711 then
|
||||
success:= false;
|
||||
|
||||
{** Test cycle and leave **}
|
||||
i:= 0;
|
||||
while true do
|
||||
begin
|
||||
@ -48,6 +65,10 @@ begin
|
||||
if i<> 2 then
|
||||
success:= false;
|
||||
|
||||
{** Does literal four char codes work**}
|
||||
{Both directly and indirectly}
|
||||
TestFourCharCode('FPas');
|
||||
TestFourCharCode(myFCCconst);
|
||||
|
||||
if success then
|
||||
Writeln('Whole test succeded')
|
||||
|
Loading…
Reference in New Issue
Block a user