/trunk/Examples/test-suite/java/special_variable_macros_runme.java

# · Java · 32 lines · 28 code · 4 blank · 0 comment · 7 complexity · 9636ea74077424819a04d0ef11cf6d8b MD5 · raw file

  1. import special_variable_macros.*;
  2. public class special_variable_macros_runme {
  3. static {
  4. try {
  5. System.loadLibrary("special_variable_macros");
  6. } catch (UnsatisfiedLinkError e) {
  7. 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);
  8. System.exit(1);
  9. }
  10. }
  11. public static void main(String argv[]) {
  12. Name name = new Name();
  13. if (!special_variable_macros.testFred(name).equals("none"))
  14. throw new RuntimeException("test failed");
  15. if (!special_variable_macros.testJack(name).equals("$specialname"))
  16. throw new RuntimeException("test failed");
  17. if (!special_variable_macros.testJill(name).equals("jilly"))
  18. throw new RuntimeException("test failed");
  19. if (!special_variable_macros.testMary(name).equals("SWIGTYPE_p_NameWrap"))
  20. throw new RuntimeException("test failed");
  21. if (!special_variable_macros.testJim(name).equals("multiname num"))
  22. throw new RuntimeException("test failed");
  23. if (special_variable_macros.testJohn(new PairIntBool(10, false)) != 123)
  24. throw new RuntimeException("test failed");
  25. NewName newName = NewName.factory("factoryname");
  26. name = newName.getStoredName();
  27. }
  28. }