diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-04-06 18:58:18 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:15:20 -0300 |
commit | f107f41c2b99517133ac4d2d624e8ee61cac2bb2 (patch) | |
tree | 5a5f4961c1189468c488c81e542b923937bd9316 /tests/libsample | |
parent | 8c506130849194b0f7838a7920b5f7cc94bfe619 (diff) |
Fixed the argument conversion of modified virtual methods.
Wrong conversion code was being outputted to virtual method wrapper code
when all arguments were removed.
Unit tests were added as well.
Diffstat (limited to 'tests/libsample')
-rw-r--r-- | tests/libsample/virtualmethods.cpp | 9 | ||||
-rw-r--r-- | tests/libsample/virtualmethods.h | 21 |
2 files changed, 29 insertions, 1 deletions
diff --git a/tests/libsample/virtualmethods.cpp b/tests/libsample/virtualmethods.cpp index 63c1c8711..bd47dbb0e 100644 --- a/tests/libsample/virtualmethods.cpp +++ b/tests/libsample/virtualmethods.cpp @@ -42,3 +42,12 @@ VirtualMethods::createStr(const char* text, Str*& ret) return true; } +void +VirtualMethods::getMargins(int* left, int* top, int* right, int* bottom) const +{ + *left = m_left; + *top = m_top; + *right = m_right; + *bottom = m_bottom; +} + diff --git a/tests/libsample/virtualmethods.h b/tests/libsample/virtualmethods.h index dc5db49f4..38a421d30 100644 --- a/tests/libsample/virtualmethods.h +++ b/tests/libsample/virtualmethods.h @@ -33,7 +33,10 @@ class LIBSAMPLE_API VirtualMethods { public: - VirtualMethods(Str name = "VirtualMethods") : m_name(name) {} + VirtualMethods(Str name = "VirtualMethods") : m_name(name) + { + m_left = m_top = m_right = m_bottom = 0; + } virtual ~VirtualMethods() {} virtual double virtualMethod0(Point pt, int val, Complex cpx, bool b); @@ -81,9 +84,25 @@ public: std::list<Str> callStrListToStdList(const StrList& strList) { return strListToStdList(strList); } virtual std::list<Str> strListToStdList(const StrList& strList ) { return strList; } + void setMargins(int left, int top, int right, int bottom) + { + m_left = left; + m_top = top; + m_right = right; + m_bottom = bottom; + } + virtual void getMargins(int* left, int* top, int* right, int* bottom) const; + void callGetMargins(int* left, int* top, int* right, int* bottom) const + { + getMargins(left, top, right, bottom); + } private: Str m_name; + int m_left; + int m_top; + int m_right; + int m_bottom; }; class LIBSAMPLE_API VirtualDaughter : public VirtualMethods |