1.1 --- a/test/dim_test.cc Tue Sep 02 00:44:17 2008 +0200
1.2 +++ b/test/dim_test.cc Tue Sep 02 10:23:23 2008 +0100
1.3 @@ -50,38 +50,38 @@
1.4 p = b/l;
1.5 check(p.x==1 && p.y==2, "Wrong dim2::Point division by a scalar.");
1.6
1.7 - typedef dim2::BoundingBox<int> BB;
1.8 - BB box1;
1.9 - check(box1.empty(), "Wrong empty() in dim2::BoundingBox.");
1.10 + typedef dim2::Box<int> Box;
1.11 + Box box1;
1.12 + check(box1.empty(), "Wrong empty() in dim2::Box.");
1.13
1.14 box1.add(a);
1.15 - check(!box1.empty(), "Wrong empty() in dim2::BoundingBox.");
1.16 + check(!box1.empty(), "Wrong empty() in dim2::Box.");
1.17 box1.add(b);
1.18
1.19 check(box1.left()==1 && box1.bottom()==2 &&
1.20 box1.right()==3 && box1.top()==4,
1.21 - "Wrong addition of points to dim2::BoundingBox.");
1.22 + "Wrong addition of points to dim2::Box.");
1.23
1.24 - check(box1.inside(Point(2,3)), "Wrong inside() in dim2::BoundingBox.");
1.25 - check(box1.inside(Point(1,3)), "Wrong inside() in dim2::BoundingBox.");
1.26 - check(!box1.inside(Point(0,3)), "Wrong inside() in dim2::BoundingBox.");
1.27 + check(box1.inside(Point(2,3)), "Wrong inside() in dim2::Box.");
1.28 + check(box1.inside(Point(1,3)), "Wrong inside() in dim2::Box.");
1.29 + check(!box1.inside(Point(0,3)), "Wrong inside() in dim2::Box.");
1.30
1.31 - BB box2(Point(2,2));
1.32 - check(!box2.empty(), "Wrong empty() in dim2::BoundingBox.");
1.33 -
1.34 + Box box2(Point(2,2));
1.35 + check(!box2.empty(), "Wrong empty() in dim2::Box.");
1.36 +
1.37 box2.bottomLeft(Point(2,0));
1.38 box2.topRight(Point(5,3));
1.39 - BB box3 = box1 & box2;
1.40 + Box box3 = box1 & box2;
1.41 check(!box3.empty() &&
1.42 - box3.left()==2 && box3.bottom()==2 &&
1.43 + box3.left()==2 && box3.bottom()==2 &&
1.44 box3.right()==3 && box3.top()==3,
1.45 - "Wrong intersection of two dim2::BoundingBox objects.");
1.46 -
1.47 + "Wrong intersection of two dim2::Box objects.");
1.48 +
1.49 box1.add(box2);
1.50 check(!box1.empty() &&
1.51 box1.left()==1 && box1.bottom()==0 &&
1.52 box1.right()==5 && box1.top()==4,
1.53 - "Wrong addition of two dim2::BoundingBox objects.");
1.54 + "Wrong addition of two dim2::Box objects.");
1.55
1.56 return 0;
1.57 }