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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| TBaseTestCase = class(TTestCase)
public
Ir1, Ir2: integer;
Fs1,Fs2 : Single;
nb, vb, ab: boolean;
end;
TVectorBaseTestCase = class(TBaseTestCase)
protected
procedure Setup; override;
public
{$CODEALIGN RECORDMIN=16}
vtt1,vtt2, vtt3, vtt4: TGLZVector2f;
vttd1,vttd2, vttd3, vttd4: TGLZVector2d;
vt1,vt2, vt3, vt4 : TGLZVector4f;
at1, at2, at3, at4, vorg: TGLZVector4f;
ntt1,ntt2, ntt3 : TNativeGLZVector2f;
nttd1,nttd2, nttd3 : TNativeGLZVector2d;
vt2i : TGLZVector2i;
vt4i : TGLZVector4i;
nt2i : TNativeGLZVector2i;
nt4i : TNativeGLZVector4i;
nt1,nt2, nt3 : TNativeGLZVector4f;
ant1,ant2, ant3, ant4, norg : TNativeGLZVector4f;
{$CODEALIGN RECORDMIN=4}
r1, rs : Single;
rd1, rds : Double;
Res: boolean;
published
end;
procedure TVectorBaseTestCase.Setup;
begin
vtt1.Create(5.850,4.525);
vtt2.Create(1.558,6.512);
ntt1.V := vtt1.V;
ntt2.V := vtt2.V;
vttd1.Create(5.850,4.525);
vttd2.Create(1.558,6.512);
nttd1.V := vttd1.V;
nttd2.V := vttd2.V;
vt1.Create(5.850,-15.480,8.512,1.5);
vt2.Create(1.558,6.512,4.525,1.0);
nt1.V := vt1.V;
nt2.V := vt2.V;
Fs1 := 1.5;
Fs2 := 5.5;
r1 := 1.5;
rs := 5.5;
rd1 := 1.5;
rds := 5.5;
res := false;
end;
TVector2OperatorsTestCase = class(TVectorBaseTestCase)
published
procedure TestCompare; // these two test ensure we have data to play
procedure TestCompareFalse; // with and tests the compare function.
procedure TestAddVector;
end;
{Test IsEqual and we have same values for each class ttpe}
procedure TVector2OperatorsTestCase.TestCompare;
begin
AssertTrue('Test Values do not match'+ntt3.ToString+' --> '+vtt3.ToString, Compare(ntt1,vtt1));
end;
procedure TVector2OperatorsTestCase.TestCompareFalse;
begin
AssertFalse('Test Values should not match'+ntt3.ToString+' --> '+vtt3.ToString, Compare(ntt1,vtt2));
end;
procedure TVector2OperatorsTestCase.TestAddVector;
begin
ntt3 := ntt2 + ntt1;
vtt3 := vtt1 + vtt2;
AssertTrue('Vector + Vector no match'+ntt3.ToString+' --> '+vtt3.ToString, Compare(ntt3,vtt3));
end; |
Partager