A testcase for testing multi-thread issues

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7241 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-06-01 20:40:45 +00:00
commit ae38d0ff23
2 changed files with 24 additions and 0 deletions

View file

@ -273,6 +273,7 @@ CPP_TEST_CASES += \
template_typedef_ptr \
template_virtual \
template_whitespace \
threads \
throw_exception \
typedef_array_member \
typedef_class \

View file

@ -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;
}
};
%}