Some modifications and another testfile.
8 void check(bool rc, char *msg="") {
11 std::cerr << "Test failed! ("<< msg << ")" << std::endl; \
22 cout << "Testing classes xy and boundingbox." << endl;
31 check(seged.x==4 && seged.y==6);
34 check(seged.x==-2 && seged.y==-2, "a-b");
36 check(a.normSquare()==5);
37 check(a*b==11, "a*b");
41 check(seged.x==2 && seged.y==4, "a*l");
44 check(seged.x==1 && seged.y==2, "b/l");
46 typedef BoundingBox<int> BB;
48 check(doboz1.empty(), "empty? Should be.");
51 check(!doboz1.empty(), "empty? Should not be.");
54 check(doboz1.bottomLeft().x==1 &&
55 doboz1.bottomLeft().y==2 &&
56 doboz1.topRight().x==3 &&
57 doboz1.topRight().y==4,
58 "added points to box");
61 check(doboz1.inside(seged),"Inside? Should be.");
64 check(doboz1.inside(seged),"Inside? Should be.");
67 check(!doboz1.inside(seged),"Inside? Should not be.");
70 check(!doboz2.empty(), "empty? Should not be. Constructed from 1 point.");
73 check(doboz2.inside(seged),"Inside? Should be. Incremented a box with an other.");
75 cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
78 return passed ? 0 : 1;