aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-02 17:39:00 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-08-02 17:50:58 -0300
commitce4b5f535f43bd2ff800b709f88c6f9c5be68003 (patch)
treeab64b0f464150c72dc639a557dc904d8e0cac783 /tests
parentd4976e7a2db93f6b031c219062b68c7310bd35ed (diff)
Created operator != or __ne__ in Point class, to avoid tests errors with Python 2.7.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/libsample/point.cpp6
-rw-r--r--tests/libsample/point.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/libsample/point.cpp b/tests/libsample/point.cpp
index 0b654020..4c527b3a 100644
--- a/tests/libsample/point.cpp
+++ b/tests/libsample/point.cpp
@@ -86,6 +86,12 @@ Point::operator+=(Point &other)
return *this;
}
+bool
+Point::operator!=(const Point &other)
+{
+ return (m_x != other.m_x) || (m_y != other.m_y);
+}
+
Point&
Point::operator-=(Point &other)
{
diff --git a/tests/libsample/point.h b/tests/libsample/point.h
index a8175039..04eb4e19 100644
--- a/tests/libsample/point.h
+++ b/tests/libsample/point.h
@@ -74,6 +74,7 @@ public:
Point& operator+=(Point &other);
Point& operator-=(Point &other);
+ bool operator!=(const Point &other);
void show();