From 484588c561f4fecb19e1c906167e8a5e20ff326d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 22 Oct 2004 21:19:10 +0000 Subject: [PATCH] director enum runtime test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6483 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../test-suite/java/director_enum_runme.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 SWIG/Examples/test-suite/java/director_enum_runme.java diff --git a/SWIG/Examples/test-suite/java/director_enum_runme.java b/SWIG/Examples/test-suite/java/director_enum_runme.java new file mode 100644 index 000000000..87874c6db --- /dev/null +++ b/SWIG/Examples/test-suite/java/director_enum_runme.java @@ -0,0 +1,36 @@ + +import director_enum.*; + +public class director_enum_runme { + + static { + try { + System.loadLibrary("director_enum"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + public static void main(String argv[]) { + + MyFoo a = new MyFoo(); + + if (a.ping(Hallo.awright) != Hallo.yo) { + throw new RuntimeException ( "a.ping()" ); + } + + Foo b = new Foo(); + + if (b.ping(Hallo.awright) != Hallo.awright) { + throw new RuntimeException ( "b.ping()" ); + } + } +} + +class MyFoo extends Foo { + public Hallo say_hi(Hallo h) { + return Hallo.yo; + } +} +