summaryrefslogtreecommitdiffstats
path: root/tests/libsample/objecttype.h
diff options
context:
space:
mode:
authorLuciano Wolf <luciano.wolf@openbossa.org>2009-11-27 15:11:09 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-11-27 16:02:18 -0300
commit9dbb330536497b07e803dda7c6368d7e875b2c3b (patch)
tree24c2138c937f79bd768e763bc9b09040d2cc62cb /tests/libsample/objecttype.h
parent909b8b91f808db71ce3658e88ed19808a5744c10 (diff)
downloadshiboken-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.h3
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; }