MCPcopy Index your code
hub / github.com/java-native-access/jna / testTooManyArgs

Method testTooManyArgs

test/com/sun/jna/FunctionTest.java:62–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 }
61
62 public void testTooManyArgs() {
63 NativeLibrary lib = NativeLibrary.getInstance(Platform.C_LIBRARY_NAME);
64 Function f = lib.getFunction("printf");
65 Object[] args = new Object[Function.MAX_NARGS+1];
66 // Make sure we don't break 'printf'
67 args[0] = getName();
68 try {
69 f.invokeInt(args);
70 fail("Arguments should be limited to " + Function.MAX_NARGS);
71 } catch(UnsupportedOperationException e) {
72 // expected
73 }
74 assertEquals("Wrong result from 'printf'", getName().length(), f.invokeInt(new Object[] { getName() }));
75 }
76
77 public void testUnsupportedReturnType() {
78 NativeLibrary lib = NativeLibrary.getInstance(Platform.C_LIBRARY_NAME);

Callers

nothing calls this directly

Calls 5

getInstanceMethod · 0.95
getFunctionMethod · 0.95
invokeIntMethod · 0.95
getNameMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected