summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw13872.pp
blob: 676a8c0bd2569ee0a039952c533d8f07ae118782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
uses
  types;

procedure TestAvg(const r: trect);
var
  res: tpoint;
  o1, o2: int64;
begin
  res:=centerpoint(r);
  o1 := (int64(r.left) + r.right) div 2;
  o2 := (int64(r.top) + r.bottom) div 2;
  if (res.x <> o1) or
     (res.y <> o2) then
    halt(1);
end;

var
 r: trect;
begin
  r.left := 1;
  r.right := 3;
  r.top := 3;
  r.bottom := 1;
  testavg(r);
  r.left:=2000000000;
  r.right:=2000000002;
  r.top:=-2000000000;
  r.bottom:=-2000000002;
  testavg(r);
  r.left:=-2000000000;
  r.right:=2000000002;
  r.top:=2000000000;
  r.bottom:=-2000000002;
end.