athos@201: #include athos@201: #include athos@201: using namespace std; athos@207: using namespace hugo; athos@513: athos@513: bool passed = true; athos@513: athos@513: void check(bool rc) { athos@513: passed = passed && rc; athos@513: if(!rc) { athos@513: cout << "Test failed!" << endl; athos@513: } athos@513: } athos@513: athos@513: athos@513: athos@201: int main() athos@201: { athos@207: athos@207: athos@201: athos@513: typedef xy XY; athos@513: athos@513: XY seged; athos@513: XY a(1,2); athos@513: XY b(3,4); athos@201: athos@513: seged = a+b; athos@513: check(seged.x==4 && seged.y==6); athos@201: athos@513: seged = a-b; athos@513: check(seged.x==-1 && seged.y==-1); athos@513: athos@513: check(a.normSquare()==5); athos@513: check(a*b==11); athos@513: athos@513: int l=2; athos@513: seged = a*l; athos@513: check(seged.x==2 && seged.y==4); athos@513: athos@513: seged = b/l; athos@513: check(seged.x==1 && seged.y==2); athos@513: athos@513: typedef BoundingBox BB; athos@513: BB doboz1; athos@513: doboz1 += a; athos@513: doboz1 += b; athos@513: athos@513: cout << (passed ? "All tests passed." : "Some of the tests failed!!!") athos@513: << endl; athos@513: athos@513: return passed ? 0 : 1; athos@513: athos@201: }