Fix a DANGEROUS bug.
3 #include "test_tools.h"
10 cout << "Testing classes `xy' and `boundingbox'." << endl;
19 check(seged.x==4 && seged.y==6, "Wrong vector addition");
22 check(seged.x==-2 && seged.y==-2, "a-b");
24 check(a.normSquare()==5,"Wrong norm calculation");
25 check(a*b==11, "a*b");
29 check(seged.x==2 && seged.y==4, "a*l");
32 check(seged.x==1 && seged.y==2, "b/l");
34 typedef BoundingBox<int> BB;
36 check(doboz1.empty(), "It should be empty.");
39 check(!doboz1.empty(), "It should not be empty.");
42 check(doboz1.bottomLeft().x==1 &&
43 doboz1.bottomLeft().y==2 &&
44 doboz1.topRight().x==3 &&
45 doboz1.topRight().y==4,
46 "added points to box");
49 check(doboz1.inside(seged),"It should be inside.");
52 check(doboz1.inside(seged),"It should be inside.");
55 check(!doboz1.inside(seged),"It should not be inside.");
58 check(!doboz2.empty(),
59 "It should not be empty. Constructed from 1 point.");
62 check(doboz2.inside(seged),
63 "It should be inside. Incremented a box with an other.");