/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
- import li_boost_shared_ptr_bits.*;
- public class li_boost_shared_ptr_bits_runme {
- static {
- try {
- System.loadLibrary("li_boost_shared_ptr_bits");
- } 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[])
- {
- VectorIntHolder v = new VectorIntHolder();
- v.add(new IntHolder(11));
- v.add(new IntHolder(22));
- v.add(new IntHolder(33));
- int sum = li_boost_shared_ptr_bits.sum(v);
- if (sum != 66)
- throw new RuntimeException("sum is wrong");
- HiddenDestructor hidden = HiddenDestructor.create();
- hidden.delete();
- }
- }