aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/pointf.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/pointf.cpp
parentf3b6eeccd43fc8b81bb7fe48424b6f4c6e4e454d (diff)
Added test for removed pointer out argument.
Diffstat (limited to 'tests/libsample/pointf.cpp')
-rw-r--r--tests/libsample/pointf.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/libsample/pointf.cpp b/tests/libsample/pointf.cpp
index 2464c22bb..509863c41 100644
--- a/tests/libsample/pointf.cpp
+++ b/tests/libsample/pointf.cpp
@@ -34,6 +34,15 @@ PointF::PointF(double x, double y) : m_x(x), m_y(y)
}
void
+PointF::midpoint(const PointF& other, PointF* midpoint) const
+{
+ if (!midpoint)
+ return;
+ midpoint->setX((m_x + other.m_x) / 2.0);
+ midpoint->setY((m_y + other.m_y) / 2.0);
+}
+
+void
PointF::show()
{
cout << "(x: " << m_x << ", y: " << m_y << ")";