aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/li_std_wstring.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/li_std_wstring.i')
-rw-r--r--Examples/test-suite/li_std_wstring.i51
1 files changed, 7 insertions, 44 deletions
diff --git a/Examples/test-suite/li_std_wstring.i b/Examples/test-suite/li_std_wstring.i
index b2b7305da..55d45383e 100644
--- a/Examples/test-suite/li_std_wstring.i
+++ b/Examples/test-suite/li_std_wstring.i
@@ -1,7 +1,9 @@
%module li_std_wstring
-%include <std_basic_string.i>
-%include <std_wstring.i>
+// The languages below are yet to provide std_wstring.i
+#if !(defined(SWIGD) || defined(SWIGGO) || defined(SWIGGUILE) || defined(SWIGJAVASCRIPT) || defined(SWIGLUA) || defined(SWIGMZSCHEME) || defined(SWIGOCAML) || defined(SWIGOCTAVE) || defined(SWIGPERL) || defined(SWIGPHP) || defined(SWIGR) || defined(SWIGSCILAB))
+
+%include <std_wstring.i>
// throw is invalid in C++17 and later, only SWIG to use it
#define TESTCASE_THROW1(T1) throw(T1)
@@ -10,26 +12,7 @@
%}
%inline %{
-
-struct A : std::wstring
-{
- A(const std::wstring& s) : std::wstring(s)
- {
- }
-};
-
-struct B
-{
- B(const std::wstring& s) : cname(0), name(s), a(s)
- {
- }
-
- char *cname;
- std::wstring name;
- A a;
-
-};
-
+#include <string>
wchar_t test_wcvalue(wchar_t x) {
return x;
@@ -63,33 +46,18 @@ const std::wstring& test_const_reference(const std::wstring &x) {
void test_pointer(std::wstring *x) {
}
-std::wstring *test_pointer_out() {
- static std::wstring x = L"x";
- return &x;
-}
-
void test_const_pointer(const std::wstring *x) {
}
-const std::wstring *test_const_pointer_out() {
- static std::wstring x = L"x";
- return &x;
-}
-
void test_reference(std::wstring &x) {
}
-std::wstring& test_reference_out() {
- static std::wstring x = L"x";
- return x;
-}
-
bool test_equal_abc(const std::wstring &s) {
return L"abc" == s;
}
void test_throw() TESTCASE_THROW1(std::wstring){
- static std::wstring x = L"x";
+ static std::wstring x = L"throwing test_throw";
throw x;
}
@@ -102,12 +70,7 @@ size_t size_wstring(const std::wstring& s) {
return s.size();
}
-#ifdef SWIGPYTHON_BUILTIN
-bool is_python_builtin() { return true; }
-#else
-bool is_python_builtin() { return false; }
-#endif
-
%}
+#endif