aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/minimalbinding
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/minimalbinding')
-rw-r--r--sources/shiboken6/tests/minimalbinding/spanuser_test.py9
-rw-r--r--sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml15
2 files changed, 23 insertions, 1 deletions
diff --git a/sources/shiboken6/tests/minimalbinding/spanuser_test.py b/sources/shiboken6/tests/minimalbinding/spanuser_test.py
index 8473ad6af..6db6aa616 100644
--- a/sources/shiboken6/tests/minimalbinding/spanuser_test.py
+++ b/sources/shiboken6/tests/minimalbinding/spanuser_test.py
@@ -28,6 +28,15 @@ class IntSpanTest(unittest.TestCase):
self.assertEqual(SpanUser.sumIntSpan(expected), 6)
self.assertEqual(SpanUser.sumConstIntSpan3(expected), 6)
+ def testSpanOpaqueContainer(self):
+ if not SpanUser.enabled():
+ return
+ oc = SpanUser.getIntSpan3_OpaqueContainer() # 1,2,3
+ oc[1] = 10
+ oc = SpanUser.getIntSpan3_OpaqueContainer()
+ # note: This converts to std::vector
+ self.assertEqual(SpanUser.sumIntSpan3(oc), 14)
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml b/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml
index ef317f415..e18bf8686 100644
--- a/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml
+++ b/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml
@@ -21,6 +21,10 @@
<opaque-container name="std::array" opaque-containers="int,3:StdIntArray"/>
+ <?if c++20?> <!-- FIXME PYSIDE 7: Remove "if" -->
+ <opaque-container name="std::span" opaque-containers="int,3:StdIntSpan3"/>
+ <?endif?>
+
<object-type name="Obj"/>
<value-type name="Val">
<enum-type name="ValEnum"/>
@@ -38,7 +42,16 @@
</modify-argument>
</modify-function>
</value-type>
- <value-type name="SpanUser"/>
+
+ <value-type name="SpanUser">
+ <?if c++20?> <!-- FIXME PYSIDE 7: Remove "if" -->
+ <modify-function signature="getIntSpan3_OpaqueContainer()">
+ <modify-argument index="return">
+ <replace-type modified-type="StdIntSpan3"/>
+ </modify-argument>
+ </modify-function>
+ <?endif?>
+ </value-type>
<value-type name="MinBoolUser"/>