瀏覽代碼

+ tests for mantis #23196 and #25122, already fixed by r25888

git-svn-id: trunk@25889 -
Jonas Maebe 11 年之前
父節點
當前提交
4becf1f3c1
共有 3 個文件被更改,包括 46 次插入0 次删除
  1. 2 0
      .gitattributes
  2. 18 0
      tests/webtbs/tw23196.pp
  3. 26 0
      tests/webtbs/tw25122.pp

+ 2 - 0
.gitattributes

@@ -13556,6 +13556,7 @@ tests/webtbs/tw2317.pp svneol=native#text/plain
 tests/webtbs/tw2318.pp svneol=native#text/plain
 tests/webtbs/tw23185.pp svneol=native#text/pascal
 tests/webtbs/tw2318b.pp svneol=native#text/plain
+tests/webtbs/tw23196.pp svneol=native#text/plain
 tests/webtbs/tw23204.pp svneol=native#text/plain
 tests/webtbs/tw23212.pp svneol=native#text/plain
 tests/webtbs/tw2323.pp svneol=native#text/plain
@@ -13627,6 +13628,7 @@ tests/webtbs/tw25059.pp svneol=native#text/pascal
 tests/webtbs/tw25077.pp svneol=native#text/pascal
 tests/webtbs/tw25081.pp svneol=native#text/pascal
 tests/webtbs/tw25101.pp svneol=native#text/pascal
+tests/webtbs/tw25122.pp svneol=native#text/plain
 tests/webtbs/tw25132.pp svneol=native#text/pascal
 tests/webtbs/tw2514.pp svneol=native#text/plain
 tests/webtbs/tw25198.pp svneol=native#text/plain

+ 18 - 0
tests/webtbs/tw23196.pp

@@ -0,0 +1,18 @@
+uses
+  sysutils;
+
+var b: extended;
+    s: string;
+begin
+{$ifdef FPC_SUPPORTS_EXTENDED}
+  b := 999999999999999999;
+  writeln(b:25:25);
+  str(b:25:25,s);
+  if s<>'999999999999999999.0000000000000000000000000' then
+    halt(1);
+  writeln(FloatToStrF(b, ffFixed, 25, 0));
+  if FloatToStrF(b, ffFixed, 25, 0)<>'999999999999999999' then
+    halt(2);
+{$endif}
+end.
+

+ 26 - 0
tests/webtbs/tw25122.pp

@@ -0,0 +1,26 @@
+
+var
+  e: record
+    case byte of
+      1: (e: extended);
+      2: (a: array[0..9] of byte);
+  end; 
+  i: longint;
+
+  { assume little endian }
+const
+  a1: array[0..9] of byte = ($f8,$da,$4f,$8d,$97,$6e,$12,$83,$f5,$43);
+  a2: array[0..9] of byte = ($05,$dd,$4f,$8d,$97,$6e,$12,$83,$f5,$43);
+begin
+{$ifdef FPC_HAS_TYPE_EXTENDED}
+  writeln('testing');
+  e.e := 1.7976931348623157e+305;
+  for i:=low(a1) to high(a1) do
+    if e.a[i]<>a1[i] then
+      halt(1);
+  e.e := 1.7976931348623158e+305;
+  for i:=low(a1) to high(a1) do
+    if e.a[i]<>a2[i] then
+      halt(2);
+{$endif}
+end.