%naturalvar feature fixes and documentation
Fix and document the naturalvar feature override behaviour - the naturalvar feature attached to a variable name has precedence over the naturalvar feature attached to the variable's type. The overriding was not working when turning the feature off on the variable's name. Fix so that any use of the naturalvar feature will override the global setting. Previously when set globally by -naturalvar or %module(naturalvar=1), use of the naturalvar feature was not always honoured.
This commit is contained in:
parent
e702093c70
commit
c34d7f6d23
6 changed files with 133 additions and 35 deletions
37
Examples/test-suite/java/naturalvar_onoff_runme.java
Normal file
37
Examples/test-suite/java/naturalvar_onoff_runme.java
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
import naturalvar_onoff.*;
|
||||
|
||||
public class naturalvar_onoff_runme {
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("naturalvar_onoff");
|
||||
} 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[])
|
||||
{
|
||||
boolean fail = true;
|
||||
Vars vars = new Vars();
|
||||
|
||||
fail = true; try {
|
||||
vars.setMember1On(null);
|
||||
} catch(NullPointerException e) {fail = false;} if (fail) throw new RuntimeException("Failed");
|
||||
|
||||
vars.setMember2Off(null);
|
||||
|
||||
vars.setMember3Off(null);
|
||||
|
||||
fail = true; try {
|
||||
vars.setMember3On(null);
|
||||
} catch(NullPointerException e) {fail = false;} if (fail) throw new RuntimeException("Failed");
|
||||
|
||||
vars.setMember4Off(null);
|
||||
|
||||
fail = true; try {
|
||||
vars.setMember4On(null);
|
||||
} catch(NullPointerException e) {fail = false;} if (fail) throw new RuntimeException("Failed");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue