aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/objectmodel.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-12-16 14:08:29 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:12:49 -0300
commit36c80e6daab7b8d69458c1a8154f4a17ee1ea303 (patch)
treeec11e8808640f67d27530f8f3ac18d62f1463751 /tests/libsample/objectmodel.cpp
parent18fedbce6893ee76c3dce04f0aaf814c93d57a34 (diff)
Added tests to check the release of ownership of objects returned from Python.
The ObjectModel test class was introduced to check if the transference of ownership of objects returned from Python to C++ through a virtual method is working properly. Also updated the other test that uses the ObjectView class. Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/libsample/objectmodel.cpp')
-rw-r--r--tests/libsample/objectmodel.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/libsample/objectmodel.cpp b/tests/libsample/objectmodel.cpp
new file mode 100644
index 000000000..93c25645e
--- /dev/null
+++ b/tests/libsample/objectmodel.cpp
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the Shiboken Python Binding Generator project.
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "objectmodel.h"
+
+void
+ObjectModel::setData(ObjectType* data)
+{
+ m_data = data;
+}
+
+ObjectType*
+ObjectModel::data() const
+{
+ return m_data;
+}
+