PageRenderTime 37ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 27 lines | 23 code | 4 blank | 0 comment | 2 complexity | a7791806cd1bf97b1a22f3824b6cb5ce MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import li_boost_shared_ptr_bits.*;
  2. public class li_boost_shared_ptr_bits_runme {
  3. static {
  4. try {
  5. System.loadLibrary("li_boost_shared_ptr_bits");
  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. {
  13. VectorIntHolder v = new VectorIntHolder();
  14. v.add(new IntHolder(11));
  15. v.add(new IntHolder(22));
  16. v.add(new IntHolder(33));
  17. int sum = li_boost_shared_ptr_bits.sum(v);
  18. if (sum != 66)
  19. throw new RuntimeException("sum is wrong");
  20. HiddenDestructor hidden = HiddenDestructor.create();
  21. hidden.delete();
  22. }
  23. }