* fixed some generic and some 64 bit-specific errors in the test

git-svn-id: trunk@8458 -
This commit is contained in:
Jonas Maebe 2007-09-13 14:37:26 +00:00
parent e271f02d1b
commit c3955767ca

View File

@ -1,3 +1,8 @@
{$mode objfpc}
uses
sysutils;
procedure testcard;
const
h = 1;
@ -8,6 +13,9 @@ var
s: shortstring;
b, b2: byte;
ch, ch2: char;
{$ifdef cpu64}
caught: boolean;
{$endif cpu64}
begin
s:='$0fffffff';
for b := low(hexch) to high(hexch) do
@ -36,8 +44,20 @@ begin
for b := low(hexch) to high(hexch) do
begin
s[length(s)]:=hexch[b];
val(s,c,l);
{$ifdef cpu64}
{$r+}
try
caught:=false;
{$endif cpu64}
val(s,c,l);
{$ifdef cpu64}
except on e : exception do
caught:=true;
end;
if not caught then
{$else cpu64}
if (l=0) then
{$endif}
halt(b2+32+h);
end;
end;
@ -64,8 +84,20 @@ begin
for ch := '6' to '9' do
begin
s[length(s)]:=ch;
val(s,c,l);
{$ifdef cpu64}
{$r+}
try
caught:=false;
{$endif cpu64}
val(s,c,l);
{$ifdef cpu64}
except on e : exception do
caught:=true;
end;
if not caught then
{$else cpu64}
if (l=0) then
{$endif cpu64}
halt(ord(ch)-ord('0')+b+54+h);
end;
@ -76,9 +108,21 @@ begin
s[b]:=ch2;
for ch := '0' to '9' do
begin
s[length(s)]:=hexch[b];
val(s,c,l);
s[length(s)]:=ch;
{$ifdef cpu64}
{$r+}
try
caught:=false;
{$endif cpu64}
val(s,c,l);
{$ifdef cpu64}
except on e : exception do
caught:=true;
end;
if not caught then
{$else cpu64}
if (l=0) then
{$endif cpu64}
halt(ord(ch2)-ord('1')+65+h);
end;
end;
@ -164,7 +208,7 @@ begin
s[b]:=ch2;
for ch := '0' to '9' do
begin
s[length(s)]:=hexch[b];
s[length(s)]:=ch;
val(s,c,l);
if (l=0) then
halt(ord(ch2)-ord('1')+61+h);