Bladeren bron

+ test for already fixed mantis 11053

git-svn-id: trunk@10636 -
Jonas Maebe 17 jaren geleden
bovenliggende
commit
668d1283a9
2 gewijzigde bestanden met toevoegingen van 58 en 0 verwijderingen
  1. 1 0
      .gitattributes
  2. 57 0
      tests/webtbs/tw11053.pp

+ 1 - 0
.gitattributes

@@ -8133,6 +8133,7 @@ tests/webtbs/tw11039a.pp svneol=native#text/plain
 tests/webtbs/tw11039b.pp svneol=native#text/plain
 tests/webtbs/tw1104.pp svneol=native#text/plain
 tests/webtbs/tw11042.pp svneol=native#text/plain
+tests/webtbs/tw11053.pp svneol=native#text/plain
 tests/webtbs/tw1111.pp svneol=native#text/plain
 tests/webtbs/tw1117.pp svneol=native#text/plain
 tests/webtbs/tw1122.pp svneol=native#text/plain

+ 57 - 0
tests/webtbs/tw11053.pp

@@ -0,0 +1,57 @@
+program Project1;
+
+{$mode delphi}
+
+const height = 1;
+      width = 1;
+
+var pix: array [0..height-1,0..width-1] of Integer;
+
+procedure Main;
+var
+    dx, dy: Integer;
+    Color, digest: cardinal;
+    cx, cy, zx, zy: Double;
+    scale: Double;
+    deep: Integer;
+
+begin
+  FillChar(pix, SizeOf(pix), $f0);
+        scale := 0.05;
+        deep := 30;
+        Digest := 0;
+
+
+      for dy := 0 to height -1 do
+      begin
+        cy := (dy - height / 2) * scale;
+        for dx := 0 to width - 1 do
+        begin
+          color := 0;
+          cx := (dx - width / 2) * scale;
+
+          zx := cx;
+          zy := cy;
+
+          while zx * zx + zy * zy < 1 do
+          begin
+            zx := zx * zx - zy * zy + cx;
+            zy := 2 * zx * zy + cy;
+            Inc( color );
+            if color > Cardinal(deep) then break;
+          end;
+          pix[ dy, dx ] := color;
+        end;
+      end;
+
+  pix[ 0, 0 ] := 80;
+
+  Digest := 0;
+  for dy := 0 to height -1 do for dx := 0 to width - 1 do Digest := Digest + pix[dy, dx];
+
+  if (digest<>80) then
+    halt(1);
+end;
+begin
+  Main;
+end.