Fix equality operator for Point2, and add test that would have caught this bug
							parent
							
								
									913affc755
								
							
						
					
					
						commit
						3d99c24d82
					
				|  | @ -148,7 +148,7 @@ public: | |||
|   /// @{
 | ||||
| 
 | ||||
|   /// equality
 | ||||
|   inline bool operator ==(const Point2& q) const {return x_==q.x_ && q.y_==q.y_;} | ||||
|   inline bool operator ==(const Point2& q) const {return x_==q.x_ && y_==q.y_;} | ||||
| 
 | ||||
|   /// get x
 | ||||
|   double x() const {return x_;} | ||||
|  |  | |||
|  | @ -61,6 +61,12 @@ TEST(Point2, constructor) { | |||
|   EXPECT(assert_equal(p1, p2)); | ||||
| } | ||||
| 
 | ||||
| /* ************************************************************************* */ | ||||
| TEST(Point2, equality) { | ||||
|   Point2 p1(1, 2), p2(1,3); | ||||
|   EXPECT(!(p1 == p2)); | ||||
| } | ||||
| 
 | ||||
| /* ************************************************************************* */ | ||||
| TEST(Point2, Lie) { | ||||
|   Point2 p1(1, 2), p2(4, 5); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue