Selaa lähdekoodia

* fixed for 64 bit targets

git-svn-id: trunk@5536 -
Jonas Maebe 18 vuotta sitten
vanhempi
commit
39324125ec
1 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 7 7
      tests/tbs/tb0515.pp

+ 7 - 7
tests/tbs/tb0515.pp

@@ -7,9 +7,9 @@ const
   count = 64;
   factor = 15;
 
-function inttopaddedstr(x: integer): string;
+function ptrtopaddedstr(x: pointer): string;
 begin
-  result := format('%02u', [x]);
+  result := format('%02p', [x]);
 end;
 
 procedure fatalerror(str: string; index: integer);
@@ -19,19 +19,19 @@ begin
 end;
 
 var
-  i, j: integer;
+  i, j: ptrint;
   strlist: tstringlist;
 begin
   strlist := tstringlist.create;
   for i := 0 to count-1 do
   begin
     j := factor*i mod count;
-    strlist.addobject(inttopaddedstr(j), tobject(j));
+    strlist.addobject(ptrtopaddedstr(pointer(j)), tobject(j));
   end;
   for i := 0 to count-1 do
   begin
     j := factor*i mod count;
-    if strlist.strings[i] <> inttopaddedstr(j) then
+    if strlist.strings[i] <> ptrtopaddedstr(pointer(j)) then
       fatalerror('string error at ', i);
     if strlist.objects[i] <> tobject(j) then
       fatalerror('object error at ', i);
@@ -39,7 +39,7 @@ begin
   strlist.sort;
   for i := 0 to count-1 do
   begin
-    if strlist.strings[i] <> inttopaddedstr(i) then
+    if strlist.strings[i] <> ptrtopaddedstr(pointer(i)) then
       fatalerror('sorted string error at ', i);
     if strlist.objects[i] <> tobject(i) then
       fatalerror('sorted object error at ', i);
@@ -51,7 +51,7 @@ begin
   j := 0;
   for i := 0 to 61 do
   begin
-    if strlist.strings[i] <> inttopaddedstr(j) then
+    if strlist.strings[i] <> ptrtopaddedstr(pointer(j)) then
       fatalerror('delete string error at ', i);
     if strlist.objects[i] <> tobject(j) then
       fatalerror('delete object error at ', i);