aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/libsample/CMakeLists.txt1
-rw-r--r--tests/libsample/injectcode.cpp64
-rw-r--r--tests/libsample/injectcode.h56
-rw-r--r--tests/samplebinding/CMakeLists.txt1
-rw-r--r--tests/samplebinding/global.h1
-rw-r--r--tests/samplebinding/typesystem_sample.xml1
6 files changed, 124 insertions, 0 deletions
diff --git a/tests/libsample/CMakeLists.txt b/tests/libsample/CMakeLists.txt
index 16a5f7561..5633a4c88 100644
--- a/tests/libsample/CMakeLists.txt
+++ b/tests/libsample/CMakeLists.txt
@@ -8,6 +8,7 @@ derived.cpp
echo.cpp
functions.cpp
implicitconv.cpp
+injectcode.cpp
kindergarten.cpp
listuser.cpp
modifications.cpp
diff --git a/tests/libsample/injectcode.cpp b/tests/libsample/injectcode.cpp
new file mode 100644
index 000000000..a53f17b59
--- /dev/null
+++ b/tests/libsample/injectcode.cpp
@@ -0,0 +1,64 @@
+/*
+ * This file is part of the Shiboken Python Binding Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "injectcode.h"
+
+InjectCode::InjectCode()
+{
+}
+
+int
+InjectCode::simpleMethod(int arg0, int arg1)
+{
+ return arg0 + arg1;
+}
+
+double
+InjectCode::overloadedMethod(int arg)
+{
+ return arg * 2;
+}
+
+double
+InjectCode::overloadedMethod(double arg)
+{
+ return arg * 1.5;
+}
+
+int
+InjectCode::virtualMethod(int arg)
+{
+ return arg * 10;
+}
+
diff --git a/tests/libsample/injectcode.h b/tests/libsample/injectcode.h
new file mode 100644
index 000000000..dca46db65
--- /dev/null
+++ b/tests/libsample/injectcode.h
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the Shiboken Python Binding Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef INJECTCODE_H
+#define INJECTCODE_H
+
+#include "complex.h"
+#include <utility>
+
+class InjectCode
+{
+public:
+ InjectCode();
+ ~InjectCode() {}
+
+ int simpleMethod(int arg0, int arg1);
+
+ double overloadedMethod(int arg);
+ double overloadedMethod(double arg);
+
+ virtual int virtualMethod(int arg);
+};
+
+#endif // INJECTCODE_H
+
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index 32ebcf75f..7e946d5b2 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -12,6 +12,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/derived_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/echo_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/implicitconv_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/intwrapper_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/injectcode_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/listuser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/mapuser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/mbase1_wrapper.cpp
diff --git a/tests/samplebinding/global.h b/tests/samplebinding/global.h
index 5bffbd287..b93cacfeb 100644
--- a/tests/samplebinding/global.h
+++ b/tests/samplebinding/global.h
@@ -5,6 +5,7 @@
#include "echo.h"
#include "functions.h"
#include "implicitconv.h"
+#include "injectcode.h"
#include "kindergarten.h"
#include "listuser.h"
#include "mapuser.h"
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index eac594b46..ce7324688 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -218,6 +218,7 @@
<value-type name="VirtualMethods"/>
<value-type name="ImplicitConv"/>
+ <value-type name="InjectCode"/>
<value-type name="Point">
<add-function signature="__str__()" return-type="PyObject*">