diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-22 17:22:37 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-03-22 17:49:02 -0300 |
commit | fc635bdc0a32888745d4428e6e033da7a9afbc7c (patch) | |
tree | 5ebabfa1c3bd0045337287db8a6b87aa7b48575a /tests/libsample | |
parent | 60b44f86deb16f925dc5fac4602c638c47cbc614 (diff) |
Adds tests to type system modifications regarding reference to pointer type.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'tests/libsample')
-rw-r--r-- | tests/libsample/virtualmethods.cpp | 12 | ||||
-rw-r--r-- | tests/libsample/virtualmethods.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/libsample/virtualmethods.cpp b/tests/libsample/virtualmethods.cpp index 997f8f249..58f8a955a 100644 --- a/tests/libsample/virtualmethods.cpp +++ b/tests/libsample/virtualmethods.cpp @@ -42,3 +42,15 @@ VirtualMethods::virtualMethod0(Point pt, int val, Complex cpx, bool b) return (pt.x() * pt.y() * val) + cpx.imag() + ((int) b); } +bool +VirtualMethods::createStr(const char* text, Str*& ret) +{ + if (!text) { + ret = 0; + return false; + } + + ret = new Str(text); + return true; +} + diff --git a/tests/libsample/virtualmethods.h b/tests/libsample/virtualmethods.h index be4c6de96..287f10e66 100644 --- a/tests/libsample/virtualmethods.h +++ b/tests/libsample/virtualmethods.h @@ -84,6 +84,10 @@ public: virtual void callMe() {} void callCallMe() { callMe(); } + // Passing reference to pointers. + virtual bool createStr(const char* text, Str*& ret); + bool callCreateStr(const char* text, Str*& ret) { return createStr(text, ret); } + private: Str m_name; }; |