summaryrefslogtreecommitdiff
path: root/Examples/test-suite/java/preproc_line_file_runme.java
diff options
context:
space:
mode:
authorDerrick <a11426@users.sourceforge.net>2011-02-14 20:11:58 +0000
committerDerrick <a11426@users.sourceforge.net>2011-02-14 20:11:58 +0000
commit5815f7ec289e067e765fb8e893a2f337d8b48303 (patch)
treeebe9e0534a089fe431cedc6fdbc1a53ac523d70c /Examples/test-suite/java/preproc_line_file_runme.java
parent3e1af1f698d5d02d7905431bcb3549c0f7bc9aa7 (diff)
parent1fab53b2046b97702e1de4cfab06cb8fa8fc129d (diff)
downloadswig-a11426-fortran.tar.gz
update fortran branch. merge of 12160:12460a11426-fortran
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/a11426-fortran@12461 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/java/preproc_line_file_runme.java')
-rw-r--r--Examples/test-suite/java/preproc_line_file_runme.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/Examples/test-suite/java/preproc_line_file_runme.java b/Examples/test-suite/java/preproc_line_file_runme.java
new file mode 100644
index 000000000..c29cef680
--- /dev/null
+++ b/Examples/test-suite/java/preproc_line_file_runme.java
@@ -0,0 +1,68 @@
+import preproc_line_file.*;
+
+public class preproc_line_file_runme {
+
+ static {
+ try {
+ System.loadLibrary("preproc_line_file");
+ } 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 String FILENAME_WINDOWS = "..\\..\\..\\..\\Examples\\test-suite\\preproc_line_file.i";
+ public static String FILENAME_UNIX = "../../../../Examples/test-suite/preproc_line_file.i";
+ public static void main(String argv[]) throws Throwable
+ {
+ int myline = preproc_line_file.MYLINE;
+ int myline_adjusted = preproc_line_file.MYLINE_ADJUSTED;
+ if (myline != 4)
+ throw new RuntimeException("preproc failure");
+ if (myline + 100 + 1 != myline_adjusted)
+ throw new RuntimeException("preproc failure");
+
+ String myfile = preproc_line_file.MYFILE;
+ String myfile_adjusted = preproc_line_file.MYFILE_ADJUSTED;
+ if (!(myfile.equals(FILENAME_UNIX) || myfile.equals(FILENAME_WINDOWS)))
+ throw new RuntimeException("preproc failure");
+
+ if (!(myfile_adjusted.equals(FILENAME_UNIX + ".bak") || myfile_adjusted.equals(FILENAME_WINDOWS + ".bak")))
+ throw new RuntimeException("preproc failure");
+
+ if (!preproc_line_file.MY_STRINGNUM_A.equals("my15"))
+ throw new RuntimeException("preproc failed MY_STRINGNUM_A");
+
+ if (!preproc_line_file.MY_STRINGNUM_B.equals("my16"))
+ throw new RuntimeException("preproc failed MY_STRINGNUM_B");
+
+ if (preproc_line_file.getThing27() != -1)
+ throw new RuntimeException("preproc failure");
+
+ if (preproc_line_file.getThing28() != -2)
+ throw new RuntimeException("preproc failure");
+
+ if (preproc_line_file.MYLINE2 != 30)
+ throw new RuntimeException("preproc failure");
+
+ if (SillyStruct.LINE_NUMBER != 52)
+ throw new RuntimeException("preproc failure");
+
+ if (SillyMacroClass.LINE_NUM != 56)
+ throw new RuntimeException("preproc failure");
+
+ if (SillyMultipleMacroStruct.LINE_NUM != 81)
+ throw new RuntimeException("preproc failure");
+
+ if (preproc_line_file.INLINE_LINE != 87)
+ throw new RuntimeException("preproc failure");
+
+ String inlineFile = preproc_line_file.INLINE_FILE;
+ if (!(inlineFile.equals(FILENAME_UNIX) || inlineFile.equals(FILENAME_WINDOWS)))
+ throw new RuntimeException("preproc failure");
+
+ if (Slash.LINE_NUM != 93)
+ throw new RuntimeException("preproc failure");
+
+ }
+}