~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/test-suite/java/director_basic_runme.java

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 14:00:28 UTC
  • mfrom: (1.2.9 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091115140028-me7amr2rie8zz1xn
Tags: 1.3.40-2ubuntu1
* Merge from Debian testing (LP: #356529), remaining changes:
  - Drop libchicken-dev from the build-depends (it's in universe)
  - Remove Pike from package description and from configure flags
  - drop "--without-mzscheme", we don't have it in our build-depends
  - use php-config5
  - Clean Runtime/ as well.
  - debian/rules (clean): Remove Lib/ocaml/swigp4.ml.
* debian/rules: Remove hardcoded python version.
* Remove upper limit for python from Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
  public static void main(String argv[]) {
16
16
 
17
 
      director_basic_MyFoo a = new director_basic_MyFoo();
18
 
 
19
 
      if (!a.ping().equals("director_basic_MyFoo::ping()")) {
20
 
          throw new RuntimeException ( "a.ping()" );
21
 
      }
22
 
 
23
 
      if (!a.pong().equals("Foo::pong();director_basic_MyFoo::ping()")) {
24
 
          throw new RuntimeException ( "a.pong()" );
25
 
      }
26
 
 
27
 
      Foo b = new Foo();
28
 
 
29
 
      if (!b.ping().equals("Foo::ping()")) {
30
 
          throw new RuntimeException ( "b.ping()" );
31
 
      }
32
 
 
33
 
      if (!b.pong().equals("Foo::pong();Foo::ping()")) {
34
 
          throw new RuntimeException ( "b.pong()" );
35
 
      }
36
 
 
37
 
      A1 a1 = new A1(1, false);
38
 
      a1.delete();
 
17
    director_basic_MyFoo a = new director_basic_MyFoo();
 
18
 
 
19
    if (!a.ping().equals("director_basic_MyFoo::ping()")) {
 
20
      throw new RuntimeException ( "a.ping()" );
 
21
    }
 
22
 
 
23
    if (!a.pong().equals("Foo::pong();director_basic_MyFoo::ping()")) {
 
24
      throw new RuntimeException ( "a.pong()" );
 
25
    }
 
26
 
 
27
    Foo b = new Foo();
 
28
 
 
29
    if (!b.ping().equals("Foo::ping()")) {
 
30
      throw new RuntimeException ( "b.ping()" );
 
31
    }
 
32
 
 
33
    if (!b.pong().equals("Foo::pong();Foo::ping()")) {
 
34
      throw new RuntimeException ( "b.pong()" );
 
35
    }
 
36
 
 
37
    A1 a1 = new A1(1, false);
 
38
    a1.delete();
 
39
 
 
40
    {
 
41
      MyOverriddenClass my = new MyOverriddenClass();
 
42
 
 
43
      my.expectNull = true;
 
44
      if (MyClass.call_pmethod(my, null) != null)
 
45
        throw new RuntimeException("null pointer marshalling problem");
 
46
 
 
47
      Bar myBar = new Bar();
 
48
      my.expectNull = false;
 
49
      Bar myNewBar = MyClass.call_pmethod(my, myBar);
 
50
      if (myNewBar == null)
 
51
        throw new RuntimeException("non-null pointer marshalling problem");
 
52
      myNewBar.setX(10);
 
53
    }
39
54
  }
40
55
}
41
56
 
45
60
    }
46
61
}
47
62
 
 
63
class MyOverriddenClass extends MyClass {
 
64
  public boolean expectNull = false;
 
65
  public boolean nonNullReceived = false;
 
66
  public Bar pmethod(Bar b) {
 
67
    if ( expectNull && (b != null) )
 
68
      throw new RuntimeException("null not received as expected");
 
69
    return b;
 
70
  }
 
71
}
 
72