Changeset 253:dbe309b5e855 in lemon1.2 for test/dim_test.cc
 Timestamp:
 08/30/08 22:19:43 (11 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

test/dim_test.cc
r242 r253 51 51 check(p.x==1 && p.y==2, "Wrong dim2::Point division by a scalar."); 52 52 53 typedef dim2::Bo undingBox<int> BB;54 B Bbox1;55 check(box1.empty(), "Wrong empty() in dim2::Bo undingBox.");53 typedef dim2::Box<int> Box; 54 Box box1; 55 check(box1.empty(), "Wrong empty() in dim2::Box."); 56 56 57 57 box1.add(a); 58 check(!box1.empty(), "Wrong empty() in dim2::Bo undingBox.");58 check(!box1.empty(), "Wrong empty() in dim2::Box."); 59 59 box1.add(b); 60 60 61 61 check(box1.left()==1 && box1.bottom()==2 && 62 62 box1.right()==3 && box1.top()==4, 63 "Wrong addition of points to dim2::Bo undingBox.");63 "Wrong addition of points to dim2::Box."); 64 64 65 check(box1.inside(Point(2,3)), "Wrong inside() in dim2::Bo undingBox.");66 check(box1.inside(Point(1,3)), "Wrong inside() in dim2::Bo undingBox.");67 check(!box1.inside(Point(0,3)), "Wrong inside() in dim2::Bo undingBox.");65 check(box1.inside(Point(2,3)), "Wrong inside() in dim2::Box."); 66 check(box1.inside(Point(1,3)), "Wrong inside() in dim2::Box."); 67 check(!box1.inside(Point(0,3)), "Wrong inside() in dim2::Box."); 68 68 69 B Bbox2(Point(2,2));70 check(!box2.empty(), "Wrong empty() in dim2::Bo undingBox.");71 69 Box box2(Point(2,2)); 70 check(!box2.empty(), "Wrong empty() in dim2::Box."); 71 72 72 box2.bottomLeft(Point(2,0)); 73 73 box2.topRight(Point(5,3)); 74 B Bbox3 = box1 & box2;74 Box box3 = box1 & box2; 75 75 check(!box3.empty() && 76 box3.left()==2 && box3.bottom()==2 && 76 box3.left()==2 && box3.bottom()==2 && 77 77 box3.right()==3 && box3.top()==3, 78 "Wrong intersection of two dim2::Bo undingBox objects.");79 78 "Wrong intersection of two dim2::Box objects."); 79 80 80 box1.add(box2); 81 81 check(!box1.empty() && 82 82 box1.left()==1 && box1.bottom()==0 && 83 83 box1.right()==5 && box1.top()==4, 84 "Wrong addition of two dim2::Bo undingBox objects.");84 "Wrong addition of two dim2::Box objects."); 85 85 86 86 return 0;
Note: See TracChangeset
for help on using the changeset viewer.