summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-16 14:37:01 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-22 19:45:24 -0300
commit735a1c4fd5a1af96fb26793a707c4151094bae9c (patch)
tree5933afdc285d70ff348e1979fc760b100909eaaf
parent541a47b1c003cfc9eaec685918ad54a463f202c2 (diff)
downloadshiboken-735a1c4fd5a1af96fb26793a707c4151094bae9c.tar.gz
shiboken-735a1c4fd5a1af96fb26793a707c4151094bae9c.tar.xz
shiboken-735a1c4fd5a1af96fb26793a707c4151094bae9c.zip
Add test for classes and inner classes inside namespaces.
-rw-r--r--tests/libsample/samplenamespace.h12
-rw-r--r--tests/samplebinding/CMakeLists.txt3
-rw-r--r--tests/samplebinding/global.h1
-rwxr-xr-xtests/samplebinding/namespace_test.py39
-rw-r--r--tests/samplebinding/typesystem_sample.xml5
5 files changed, 58 insertions, 2 deletions
diff --git a/tests/libsample/samplenamespace.h b/tests/libsample/samplenamespace.h
index 7e0ec38c..2cc371e3 100644
--- a/tests/libsample/samplenamespace.h
+++ b/tests/libsample/samplenamespace.h
@@ -68,6 +68,18 @@ LIBSAMPLE_API inline double powerOfTwo(double num) {
LIBSAMPLE_API void doSomethingWithArray(const unsigned char* data, unsigned int size, const char* format = 0);
+class SomeClass
+{
+public:
+ class SomeInnerClass
+ {
+ public:
+ class OkThisIsRecursiveEnough
+ {
+ };
+ };
+};
+
} // namespace SampleNamespace
#endif // SAMPLENAMESPACE_H
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index 7510b5b3..36d3c4c0 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -54,6 +54,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/protectedvirtualdestructor_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/reference_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/sample_module_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_someclass_someinnerclass_okthisisrecursiveenough_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_someclass_someinnerclass_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_someclass_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/simplefile_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/size_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/sonofmderived1_wrapper.cpp
diff --git a/tests/samplebinding/global.h b/tests/samplebinding/global.h
index f54fb516..dd93c9a4 100644
--- a/tests/samplebinding/global.h
+++ b/tests/samplebinding/global.h
@@ -35,4 +35,3 @@
#include "sometime.h"
#include "virtualmethods.h"
#include "voidholder.h"
-
diff --git a/tests/samplebinding/namespace_test.py b/tests/samplebinding/namespace_test.py
new file mode 100755
index 00000000..942b6556
--- /dev/null
+++ b/tests/samplebinding/namespace_test.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# This file is part of the Shiboken Python Bindings 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.
+# #
+# 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
+
+'''Test cases for std::map container conversions'''
+
+import unittest
+from sample import *
+
+class TestClassesUnderNamespace(unittest.TestCase):
+ def testIt(self):
+ c1 = SampleNamespace.SomeClass()
+ c2 = SampleNamespace.SomeClass.SomeInnerClass()
+ c3 = SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 5f66e760..bb0d98e1 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -97,6 +97,10 @@
</modify-function>
</namespace-type>
+ <value-type name="SampleNamespace::SomeClass" />
+ <value-type name="SampleNamespace::SomeClass::SomeInnerClass" />
+ <value-type name="SampleNamespace::SomeClass::SomeInnerClass::OkThisIsRecursiveEnough" />
+
<object-type name="Abstract">
<modify-function signature="id()" rename="id_"/>
</object-type>
@@ -1060,7 +1064,6 @@
<rejection class="ListUser" function-name="sumList(std::list&lt;int&gt;)"/>
<rejection class="ListUser" function-name="sumList(std::list&lt;double&gt;)"/>
-
<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" />