aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-11 17:27:52 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-08-11 17:59:10 -0300
commit3152bd2bd728bac6ef751bb8acd64100c4ca8a83 (patch)
treeed4633d582cd30d9c171ba60fbc9ee8bb06d3a42 /tests
parentecfb5f1a7508cef02789363446c66bacf02ce3fa (diff)
Created unit test to operator().
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/libsample/valueandvirtual.h53
-rw-r--r--tests/samplebinding/CMakeLists.txt1
-rw-r--r--tests/samplebinding/global.h1
-rw-r--r--tests/samplebinding/typesystem_sample.xml1
4 files changed, 56 insertions, 0 deletions
diff --git a/tests/libsample/valueandvirtual.h b/tests/libsample/valueandvirtual.h
new file mode 100644
index 000000000..d13a2c155
--- /dev/null
+++ b/tests/libsample/valueandvirtual.h
@@ -0,0 +1,53 @@
+/*
+ * 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 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 VALUEANDVIRTUAL_H
+#define VALUEANDVIRTUAL_H
+
+class ValueAndVirtual
+{
+public:
+ ValueAndVirtual(int id) : m_id(id) {}
+ ValueAndVirtual(const ValueAndVirtual &other) { m_id = other.m_id; }
+
+ bool operator()(int id, int id2) { return id == id2; }
+
+ inline int id() { return m_id; }
+ virtual ~ValueAndVirtual() {};
+private:
+ int m_id;
+};
+
+#endif // VALUEANDVIRTUAL_H
+
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index a9dea7cf6..0dbf1170e 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -71,6 +71,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/virtualdaughter_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/virtualdtor_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/virtualmethods_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/voidholder_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/valueandvirtual_wrapper.cpp
)
find_program(GENERATOR generatorrunner REQUIRED)
diff --git a/tests/samplebinding/global.h b/tests/samplebinding/global.h
index 2ad921331..861491c12 100644
--- a/tests/samplebinding/global.h
+++ b/tests/samplebinding/global.h
@@ -36,3 +36,4 @@
#include "sometime.h"
#include "virtualmethods.h"
#include "voidholder.h"
+#include "valueandvirtual.h"
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index e949029ea..24b4ff875 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -1090,6 +1090,7 @@
<rejection class="ListUser" function-name="sumList(std::list&lt;int&gt;)"/>
<rejection class="ListUser" function-name="sumList(std::list&lt;double&gt;)"/>
+ <value-type name="ValueAndVirtual" />
<suppress-warning text="::*" />
<suppress-warning text="horribly broken type '__off64_t'" />
<suppress-warning text="enum '__codecvt_result' does not have a type entry or is not an enum" />