Add test case to demonstrate the name collision that occurs in the generated C# code when a namespace is named System.

This commit is contained in:
Brant K. Kyser 2013-10-15 13:55:35 -05:00
commit 0f1e73fd26
2 changed files with 40 additions and 0 deletions

View file

@ -17,6 +17,7 @@ CPP_TEST_CASES = \
csharp_exceptions \
csharp_features \
csharp_lib_arrays \
csharp_namespace_system_collision \
csharp_prepost \
csharp_typemaps \
enum_thorough_simple \

View file

@ -0,0 +1,39 @@
%module namespace_system_collision
%{
#include <string>
namespace TopLevel
{
namespace System
{
class Foo {
public:
virtual ~Foo() {}
virtual std::string ping() { return "TopLevel::System::Foo::ping()"; }
};
}
}
%}
%include <std_string.i>
// nspace feature only supported by these languages
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGD)
%nspace;
#else
#warning nspace feature not yet supported in this target language
#endif
namespace TopLevel
{
namespace System
{
class Foo {
public:
virtual ~Foo();
virtual std::string ping();
};
}
}