Browse Source

* fixed test for 64 bit targets

florian 21 years ago
parent
commit
4e8795893e
1 changed files with 5 additions and 5 deletions
  1. 5 5
      tests/webtbs/tw2911.pp

+ 5 - 5
tests/webtbs/tw2911.pp

@@ -24,10 +24,10 @@ procedure RefCount(const s : string;expect:longint);
 type
         PLongint = ^Longint;
 var
-        P : PLongint;
+        P : psizeint;
         rc : longint;
 begin
-        P := PLongint(s);
+        P := psizeint(s);
         rc:=0;
         if (p = nil)
         then writeln('Nil string.')
@@ -36,10 +36,10 @@ begin
   {$if defined(ver1_0) or defined(ver1_9_4)}
          rc:=(p-1)^;
   {$else}
-         rc:=plongint(pchar(p)-8)^;
+         rc:=psizeint(pchar(p)-sizeof(sizeint)*2)^;
   {$endif}
 {$else}
-         rc:=plongint(pchar(p)-8)^;
+         rc:=psizeint(pchar(p)-sizeof(sizeint)*2)^;
 {$endif}
   writeln('Ref count is ',rc,' expected ',expect);
   if rc<>expect then
@@ -69,4 +69,4 @@ begin
         ARecordWithStrings := FunctionResultIsRecord(ARecordWithStrings);
         twostring := onestring + twostring;
         RefCount(ARecordWithStrings.one,2);
-end.
+end.