summaryrefslogtreecommitdiff
path: root/Examples/test-suite/default_arg_expressions.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2018-01-05 18:31:48 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2018-01-05 18:31:48 +0000
commitaef25cff0cd3fc1bbae1a8d26825fe5f80fce770 (patch)
tree7e628e4b0ad99e237ea743029f403610c334e935 /Examples/test-suite/default_arg_expressions.i
parentef378407d064142672ccb55cbff47723a14f162c (diff)
downloadswig-aef25cff0cd3fc1bbae1a8d26825fe5f80fce770.tar.gz
Add missing default_arg_expressions.i testcase
Diffstat (limited to 'Examples/test-suite/default_arg_expressions.i')
-rw-r--r--Examples/test-suite/default_arg_expressions.i30
1 files changed, 30 insertions, 0 deletions
diff --git a/Examples/test-suite/default_arg_expressions.i b/Examples/test-suite/default_arg_expressions.i
new file mode 100644
index 000000000..ca2a27e33
--- /dev/null
+++ b/Examples/test-suite/default_arg_expressions.i
@@ -0,0 +1,30 @@
+%module default_arg_expressions
+
+%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) ptr;
+%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) UsdGeomTokensPtr;
+%immutable UsdGeomTokens;
+
+%inline %{
+struct Numbers {
+ int val;
+ int *ptr;
+ Numbers() : val(), ptr(&val) {}
+};
+struct TfToken {
+ Numbers val;
+ Numbers *ptr;
+ TfToken() : val(), ptr(&val) {}
+};
+struct Tokens {
+ const TfToken face;
+ const TfToken *pface;
+ Tokens() : face(), pface(&face) {}
+};
+static Tokens UsdGeomTokens;
+static Tokens *UsdGeomTokensPtr = &UsdGeomTokens;
+void CreateMaterialBindSubset1(const Tokens &elementType = UsdGeomTokens) {}
+void CreateMaterialBindSubset2(int num = UsdGeomTokensPtr->pface->val.val) {}
+void CreateMaterialBindSubset3(int num = UsdGeomTokensPtr->pface->ptr->val) {}
+void CreateMaterialBindSubset4(int num = UsdGeomTokensPtr->face.val.val) {}
+//void CreateMaterialBindSubset5(int num = UsdGeomTokens.face.val.val) {}
+%}