Fix for the imports testcase breaking - many of the tests have classes with the same names and so these were being compiled as .class files in this directory. Solved this by giving these classes unique names based on the test name.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7175 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-04-28 22:13:32 +00:00
parent c2e9c01ab1
commit dadc8efd14
10 changed files with 65 additions and 65 deletions

View File

@ -14,17 +14,17 @@ public class director_abstract_runme {
public static void main(String argv[]) {
MyFoo a = new MyFoo();
director_abstract_MyFoo a = new director_abstract_MyFoo();
if (!a.ping().equals("MyFoo::ping()")) {
if (!a.ping().equals("director_abstract_MyFoo::ping()")) {
throw new RuntimeException ( "a.ping()" );
}
if (!a.pong().equals("Foo::pong();MyFoo::ping()")) {
if (!a.pong().equals("Foo::pong();director_abstract_MyFoo::ping()")) {
throw new RuntimeException ( "a.pong()" );
}
BadFoo b = new BadFoo();
director_abstract_BadFoo b = new director_abstract_BadFoo();
try {
b.ping();
System.out.println( "Test failed. An attempt to call a pure virtual method should throw an exception" );
@ -35,12 +35,12 @@ public class director_abstract_runme {
}
}
class MyFoo extends Foo {
class director_abstract_MyFoo extends Foo {
public String ping() {
return "MyFoo::ping()";
return "director_abstract_MyFoo::ping()";
}
}
class BadFoo extends Foo {
class director_abstract_BadFoo extends Foo {
}

View File

@ -14,13 +14,13 @@ public class director_basic_runme {
public static void main(String argv[]) {
MyFoo a = new MyFoo();
director_basic_MyFoo a = new director_basic_MyFoo();
if (!a.ping().equals("MyFoo::ping()")) {
if (!a.ping().equals("director_basic_MyFoo::ping()")) {
throw new RuntimeException ( "a.ping()" );
}
if (!a.pong().equals("Foo::pong();MyFoo::ping()")) {
if (!a.pong().equals("Foo::pong();director_basic_MyFoo::ping()")) {
throw new RuntimeException ( "a.pong()" );
}
@ -39,9 +39,9 @@ public class director_basic_runme {
}
}
class MyFoo extends Foo {
class director_basic_MyFoo extends Foo {
public String ping() {
return "MyFoo::ping()";
return "director_basic_MyFoo::ping()";
}
}

View File

@ -14,15 +14,15 @@ public class director_default_runme {
public static void main(String argv[]) {
{
MyFoo a = new MyFoo();
a = new MyFoo(10);
director_default_MyFoo a = new director_default_MyFoo();
a = new director_default_MyFoo(10);
}
MyFoo a = new MyFoo();
if (!a.GetMsg().equals("MyFoo-default")) {
director_default_MyFoo a = new director_default_MyFoo();
if (!a.GetMsg().equals("director_default_MyFoo-default")) {
throw new RuntimeException ( "Test 1 failed" );
}
if (!a.GetMsg("boo").equals("MyFoo-boo")) {
if (!a.GetMsg("boo").equals("director_default_MyFoo-boo")) {
throw new RuntimeException ( "Test 2 failed" );
}
@ -37,15 +37,15 @@ public class director_default_runme {
}
}
class MyFoo extends Foo {
public MyFoo() {
class director_default_MyFoo extends Foo {
public director_default_MyFoo() {
super();
}
public MyFoo(int i) {
public director_default_MyFoo(int i) {
super(i);
}
public String Msg(String msg) {
return "MyFoo-" + msg;
return "director_default_MyFoo-" + msg;
}
}

View File

@ -14,7 +14,7 @@ public class director_enum_runme {
public static void main(String argv[]) {
MyFoo a = new MyFoo();
director_enum_MyFoo a = new director_enum_MyFoo();
if (a.ping(Hallo.awright) != Hallo.yo) {
throw new RuntimeException ( "a.ping()" );
@ -40,7 +40,7 @@ public class director_enum_runme {
}
}
class MyFoo extends Foo {
class director_enum_MyFoo extends Foo {
public Hallo say_hi(Hallo h) {
return Hallo.yo;
}

View File

@ -14,7 +14,7 @@ public class director_exception_runme {
public static void main(String argv[]) {
MyFoo a = new MyFoo();
director_exception_MyFoo a = new director_exception_MyFoo();
Foo b = director_exception.launder(a);
try {
@ -26,7 +26,7 @@ public class director_exception_runme {
}
}
class MyFoo extends Foo {
class director_exception_MyFoo extends Foo {
public String ping() {
throw new UnsupportedOperationException("Foo::ping not implemented");
}

View File

@ -17,19 +17,19 @@ public class director_protected_runme {
Bar b = new Bar();
Foo f = b.create();
FooBar fb = new FooBar();
FooBar2 fb2 = new FooBar2();
director_protected_FooBar fb = new director_protected_FooBar();
director_protected_FooBar2 fb2 = new director_protected_FooBar2();
{
String s = fb.used();
if (!s.equals("Foo::pang();Bar::pong();Foo::pong();FooBar::ping();"))
throw new RuntimeException( "bad FooBar::used" );
if (!s.equals("Foo::pang();Bar::pong();Foo::pong();director_protected_FooBar::ping();"))
throw new RuntimeException( "bad director_protected_FooBar::used" );
}
{
String s = fb2.used();
if (!s.equals("FooBar2::pang();Bar::pong();Foo::pong();FooBar2::ping();"))
throw new RuntimeException( "bad FooBar2::used" );
if (!s.equals("director_protected_FooBar2::pang();Bar::pong();Foo::pong();director_protected_FooBar2::ping();"))
throw new RuntimeException( "bad director_protected_FooBar2::used" );
}
{
@ -46,8 +46,8 @@ public class director_protected_runme {
{
String s3 = fb.pong();
if (!s3.equals("Bar::pong();Foo::pong();FooBar::ping();"))
throw new RuntimeException(" bad FooBar::pong" );
if (!s3.equals("Bar::pong();Foo::pong();director_protected_FooBar::ping();"))
throw new RuntimeException(" bad director_protected_FooBar::pong" );
}
try {
@ -68,18 +68,18 @@ public class director_protected_runme {
}
}
class FooBar extends Bar {
class director_protected_FooBar extends Bar {
public String ping() {
return "FooBar::ping();";
return "director_protected_FooBar::ping();";
}
}
class FooBar2 extends Bar {
class director_protected_FooBar2 extends Bar {
public String ping() {
return "FooBar2::ping();";
return "director_protected_FooBar2::ping();";
}
public String pang() {
return "FooBar2::pang();";
return "director_protected_FooBar2::pang();";
}
}

View File

@ -14,28 +14,28 @@ public class director_string_runme {
public static void main(String argv[]) {
B b = new B("hello");
director_string_B b = new director_string_B("hello");
String s;
s = b.call_get_first();
if (!s.equals("B.get_first")) throw new RuntimeException("call_get_first() failed");
if (!s.equals("director_string_B.get_first")) throw new RuntimeException("call_get_first() failed");
s = b.call_get(0);
if (!s.equals("B.get: hello")) throw new RuntimeException("get(0) failed");
if (!s.equals("director_string_B.get: hello")) throw new RuntimeException("get(0) failed");
}
}
class B extends A {
public B(String first) {
class director_string_B extends A {
public director_string_B(String first) {
super(first);
}
public String get_first() {
return "B.get_first";
return "director_string_B.get_first";
}
public String get(int n) {
return "B.get: " + super.get(n);
return "director_string_B.get: " + super.get(n);
}
}

View File

@ -14,21 +14,21 @@ public class director_unroll_runme {
public static void main(String argv[]) {
MyFoo a = new MyFoo();
director_unroll_MyFoo a = new director_unroll_MyFoo();
Bar b = new Bar();
b.set(a);
Foo c = b.get();
if (!c.ping().equals("MyFoo::ping()"))
if (!c.ping().equals("director_unroll_MyFoo::ping()"))
throw new RuntimeException ( "c.ping()" );
}
}
class MyFoo extends Foo {
class director_unroll_MyFoo extends Foo {
public String ping() {
return "MyFoo::ping()";
return "director_unroll_MyFoo::ping()";
}
}

View File

@ -24,28 +24,28 @@ public class director_wombat_runme
a.delete();
a = new Foo_integers_derived();
a = new director_wombat_Foo_integers_derived();
if ((retval = a.meth(62)) != 62 + 2) {
throw new RuntimeException ("Test failed: retval = " + retval + ", expected 62 + 2");
}
a.delete();
a = new Foo_integers_derived_2();
a = new director_wombat_Foo_integers_derived_2();
if ((retval = a.meth(37)) != 37) {
throw new RuntimeException ("Test failed: retval = " + retval + ", expected 37");
}
b.delete();
b = new Bar_derived_1();
b = new director_wombat_Bar_derived_1();
b.foo_meth(a, 0);
}
}
class Foo_integers_derived extends Foo_integers
class director_wombat_Foo_integers_derived extends Foo_integers
{
public Foo_integers_derived()
public director_wombat_Foo_integers_derived()
{
super();
}
@ -56,25 +56,25 @@ class Foo_integers_derived extends Foo_integers
}
}
class Foo_integers_derived_2 extends Foo_integers
class director_wombat_Foo_integers_derived_2 extends Foo_integers
{
public Foo_integers_derived_2()
public director_wombat_Foo_integers_derived_2()
{
super();
}
}
class Bar_derived_1 extends Bar
class director_wombat_Bar_derived_1 extends Bar
{
public Bar_derived_1()
public director_wombat_Bar_derived_1()
{
super();
}
public void foo_meth(Foo_integers foo_obj, int param)
{
if (!(foo_obj instanceof Foo_integers_derived_2)) {
throw new RuntimeException ("Test failed: foo_obj is not Foo_integers_derived_2, got " + foo_obj);
if (!(foo_obj instanceof director_wombat_Foo_integers_derived_2)) {
throw new RuntimeException ("Test failed: foo_obj is not director_wombat_Foo_integers_derived_2, got " + foo_obj);
}
}
}

View File

@ -56,20 +56,20 @@ public class java_director_runme {
QuuxContainer qc = new QuuxContainer();
qc.push(new Quux("element 1"));
qc.push(new MyQuux("element 2"));
qc.push(new MyQuux("element 3"));
qc.push(new java_director_MyQuux("element 2"));
qc.push(new java_director_MyQuux("element 3"));
qc.push(new Quux("element 4"));
return qc;
}
}
class MyQuux extends Quux {
public MyQuux(String arg) {
class java_director_MyQuux extends Quux {
public java_director_MyQuux(String arg) {
super(arg);
}
public String director_method() {
return "MyQuux:" + member();
return "java_director_MyQuux:" + member();
}
}