diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-03 17:20:31 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-03 17:20:31 -0300 |
commit | e01eba39663c2f7d0f1137ab30ed18891394afb5 (patch) | |
tree | cbd3d28de96353e870258f183b9df3b4948af957 /tests/libsample/point.cpp | |
parent | 2b54063938045567453daaa17c33b323e68b890f (diff) |
updated Point tests with cases for returning Point pointer,
const pointer and const reference
Diffstat (limited to 'tests/libsample/point.cpp')
-rw-r--r-- | tests/libsample/point.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/libsample/point.cpp b/tests/libsample/point.cpp index 410e1c8cb..0b6540202 100644 --- a/tests/libsample/point.cpp +++ b/tests/libsample/point.cpp @@ -39,12 +39,19 @@ using namespace std; Point::Point(int x, int y) : m_x(x), m_y(y) { - // cout << __PRETTY_FUNCTION__ << " [x=0, y=0]" << endl; } Point::Point(double x, double y) : m_x(x), m_y(y) { - // cout << __PRETTY_FUNCTION__ << endl; +} + +Point* +Point::copy() const +{ + Point* pt = new Point(); + pt->m_x = m_x; + pt->m_y = m_y; + return pt; } void |