mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-13 15:39:33 +01: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
|
var
|
||||||
success: Boolean = true;
|
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;
|
procedure Proc;
|
||||||
|
|
||||||
@ -15,16 +20,27 @@ begin
|
|||||||
Exit(Proc);
|
Exit(Proc);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
procedure TestFourCharCode(myFCC: MyFourCharCodeType);
|
||||||
a = true;
|
|
||||||
b = true;
|
begin
|
||||||
c = false;
|
Writeln('FPC creator code as number: ', myFCC);
|
||||||
|
if myFCC <> $46506173 then
|
||||||
|
success := false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
myFCCconst = 'FPas'; {Free Pascals Creator code :) }
|
||||||
|
|
||||||
var
|
var
|
||||||
p: pointer;
|
p: pointer;
|
||||||
l,i: longint;
|
l,i: longint;
|
||||||
|
a,b,c : Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
a := true;
|
||||||
|
b := true;
|
||||||
|
c := false;
|
||||||
|
|
||||||
{** Test & and | as alias for AND and OR **}
|
{** Test & and | as alias for AND and OR **}
|
||||||
if not (a & b) then
|
if not (a & b) then
|
||||||
success:= false;
|
success:= false;
|
||||||
@ -37,6 +53,7 @@ begin
|
|||||||
if l <> 4711 then
|
if l <> 4711 then
|
||||||
success:= false;
|
success:= false;
|
||||||
|
|
||||||
|
{** Test cycle and leave **}
|
||||||
i:= 0;
|
i:= 0;
|
||||||
while true do
|
while true do
|
||||||
begin
|
begin
|
||||||
@ -48,6 +65,10 @@ begin
|
|||||||
if i<> 2 then
|
if i<> 2 then
|
||||||
success:= false;
|
success:= false;
|
||||||
|
|
||||||
|
{** Does literal four char codes work**}
|
||||||
|
{Both directly and indirectly}
|
||||||
|
TestFourCharCode('FPas');
|
||||||
|
TestFourCharCode(myFCCconst);
|
||||||
|
|
||||||
if success then
|
if success then
|
||||||
Writeln('Whole test succeded')
|
Writeln('Whole test succeded')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user