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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
unit toperator3;
interface
type
op2 = record
x,y,z : longint;
end;
operator + (const a,b : op2) c : op2;
implementation
uses
toperator2,toperator4;
operator + (const a,b : op2) c : op2;
begin
c.x:=a.x+b.x;
c.y:=a.y+b.y;
end;
procedure test_op3;
var
a,b,c : op3;
begin
a.x:=44.0;
a.y:=67.0;
b.x:=-34.0;
b.y:=-57.0;
c:=a+b;
if (c.x<>10.0) or (c.y<>10.0) then
Halt(1);
end;
procedure test_op2;
var
a,b,c : op2;
begin
a.x:=44;
a.y:=67;
b.x:=-34;
b.y:=-57;
c:=a+b;
if (c.x<>10) or (c.y<>10) then
Halt(1);
end;
procedure test_op1;
var
a,b,c : op1;
begin
a.x:=44;
a.y:=67;
b.x:=-34;
b.y:=-57;
c:=a+b;
if (c.x<>10) or (c.y<>10) then
Halt(1);
end;
begin
test_op1;
test_op2;
test_op3;
end.
|