Browse Source

* fix test

florian 3 năm trước cách đây
mục cha
commit
e2624fdaaa
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      tests/webtbs/tw39357.pp

+ 6 - 2
tests/webtbs/tw39357.pp

@@ -10,10 +10,10 @@ function get_sign(d: double): Integer;
     inc(p,4);
     inc(p,4);
 {$else}
 {$else}
 {$ifdef FPC_LITTLE_ENDIAN}
 {$ifdef FPC_LITTLE_ENDIAN}
-    inc(p,4);
+    inc(p,sizeof(d)-1);
 {$endif}
 {$endif}
 {$endif}
 {$endif}
-    if (p^ and $80)=0 then
+    if (p^ and $80)<>0 then
       get_sign:=-1;
       get_sign:=-1;
   end;
   end;
 
 
@@ -23,6 +23,10 @@ var
     zero : Double;
     zero : Double;
 begin
 begin
     zero:=0.0;
     zero:=0.0;
+
+    if get_sign(1.0)<>1 then
+      halt(1);
+
 	writeln(-zero);
 	writeln(-zero);
     if get_sign(-zero)<>-1 then
     if get_sign(-zero)<>-1 then
       halt(1);
       halt(1);