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

Method testStringReturn

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

Source from the content-addressed store, hash-verified

120 }
121
122 public void testStringReturn() throws UnsupportedEncodingException {
123 // String with german umlauts
124 String input = "Hallo äöüß";
125
126 String result;
127 Memory mem = new Memory(32);
128 mem.clear();
129 mem.write(0, input.getBytes("UTF-8"), 0, input.getBytes("UTF-8").length);
130 result = libUTF8Interface.returnStringArgument(mem);
131 assertEquals(input, result);
132 mem.clear();
133 mem.write(0, input.getBytes("ISO-8859-1"), 0, input.getBytes("ISO-8859-1").length);
134 result = libLatin1Interface.returnStringArgument(mem);
135 assertEquals(input, result);
136 }
137
138 public void testStringReturnDirect() throws UnsupportedEncodingException {
139 // String with german umlauts

Callers

nothing calls this directly

Calls 4

clearMethod · 0.95
writeMethod · 0.95
returnStringArgumentMethod · 0.65
getBytesMethod · 0.45

Tested by

no test coverage detected