Merged in fix/Point2_equality (pull request #144)
Fix equality operator for Point2, and add test that would have caught this bugrelease/4.3a0
commit
1f4d384d8d
|
|
@ -148,7 +148,7 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// equality
|
/// 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
|
/// get x
|
||||||
double x() const {return x_;}
|
double x() const {return x_;}
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,12 @@ TEST(Point2, constructor) {
|
||||||
EXPECT(assert_equal(p1, p2));
|
EXPECT(assert_equal(p1, p2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
TEST(Point2, equality) {
|
||||||
|
Point2 p1(1, 2), p2(1,3);
|
||||||
|
EXPECT(!(p1 == p2));
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST(Point2, Lie) {
|
TEST(Point2, Lie) {
|
||||||
Point2 p1(1, 2), p2(4, 5);
|
Point2 p1(1, 2), p2(4, 5);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue