Browse Source

+ test for four char codes

git-svn-id: trunk@442 -
olle 20 years ago
parent
commit
c92377604c
1 changed files with 25 additions and 4 deletions
  1. 25 4
      tests/test/tmacpas2.pp

+ 25 - 4
tests/test/tmacpas2.pp

@@ -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')