diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2009-11-27 15:11:09 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-27 16:02:18 -0300 |
commit | 9dbb330536497b07e803dda7c6368d7e875b2c3b (patch) | |
tree | 24c2138c937f79bd768e763bc9b09040d2cc62cb /tests/libsample/objecttype.h | |
parent | 909b8b91f808db71ce3658e88ed19808a5744c10 (diff) | |
download | shiboken-9dbb330536497b07e803dda7c6368d7e875b2c3b.tar.gz shiboken-9dbb330536497b07e803dda7c6368d7e875b2c3b.tar.xz shiboken-9dbb330536497b07e803dda7c6368d7e875b2c3b.zip |
Test ownership transfer from Python to C++
There are 3 tests to be implemented in order to check the correctness.
- 1. Correct the assert function inside kindergarten example to raise an exception [done];
- 2. Use "create" method to return a C++ created instance and use it to test ownership [done];
- 3. Use e.g.: "Point" class as a value-type to test "invalidate non-polymorphic".
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/libsample/objecttype.h')
-rw-r--r-- | tests/libsample/objecttype.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/libsample/objecttype.h b/tests/libsample/objecttype.h index eac12fd7..8a97c669 100644 --- a/tests/libsample/objecttype.h +++ b/tests/libsample/objecttype.h @@ -62,6 +62,9 @@ public: ObjectType(ObjectType* parent = 0); virtual ~ObjectType(); + // factory method + static ObjectType* create() { return new ObjectType(); } + void setParent(ObjectType* parent); ObjectType* parent() const { return m_parent; } const ObjectTypeList& children() const { return m_children; } |