diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 3353d7f01..61fe73d13 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -273,6 +273,7 @@ CPP_TEST_CASES += \ template_typedef_ptr \ template_virtual \ template_whitespace \ + threads \ throw_exception \ typedef_array_member \ typedef_class \ diff --git a/Examples/test-suite/threads.i b/Examples/test-suite/threads.i new file mode 100644 index 000000000..7c6b09be0 --- /dev/null +++ b/Examples/test-suite/threads.i @@ -0,0 +1,23 @@ +// This test is designed for testing wrappers in the target language in a multi-threaded environment. +// The most common cause for this test failing is incorrect compiler settings for a multi-threaded environment. + +%module threads + +%include "std_string.i" + +%newobject Kerfuffle::CharString; + +%inline %{ + #include + struct Kerfuffle { + std::string StdString(std::string str) { + return str; + } + char * CharString(const char *str) { + char * retstr = new char[256]; + strcpy(retstr, str); + return retstr; + } + }; +%} +