diff options
Diffstat (limited to 'Examples/test-suite/threads.i')
| -rw-r--r-- | Examples/test-suite/threads.i | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Examples/test-suite/threads.i b/Examples/test-suite/threads.i new file mode 100644 index 0000000..7c6b09b --- /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 <string> + 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; + } + }; +%} + |
