aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/point.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-02 13:06:58 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:07 -0300
commit6bb2780c978d93b6ebe7b423adda27e4292467f2 (patch)
tree975bb03485f15e28e514a5333fdced6f8a2c246f /tests/libsample/point.cpp
parentf3b6eeccd43fc8b81bb7fe48424b6f4c6e4e454d (diff)
Added test for removed pointer out argument.
Diffstat (limited to 'tests/libsample/point.cpp')
-rw-r--r--tests/libsample/point.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/libsample/point.cpp b/tests/libsample/point.cpp
index 484e7c11c..61e2830e4 100644
--- a/tests/libsample/point.cpp
+++ b/tests/libsample/point.cpp
@@ -33,6 +33,15 @@ Point::Point(double x, double y) : m_x(x), m_y(y)
{
}
+void
+Point::midpoint(const Point& other, Point* midpoint) const
+{
+ if (!midpoint)
+ return;
+ midpoint->setX((m_x + other.m_x) / 2.0);
+ midpoint->setY((m_y + other.m_y) / 2.0);
+}
+
Point*
Point::copy() const
{