MCPcopy Create free account
hub / github.com/java-native-access/jna / testToStringList

Method testToStringList

test/com/sun/jna/NativeTest.java:119–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117 }
118
119 public void testToStringList() {
120 List<String> expected = Arrays.asList(getClass().getPackage().getName(), getClass().getSimpleName(), "testToStringList");
121 StringBuilder sb = new StringBuilder();
122 for (String value : expected) {
123 sb.append(value).append('\0');
124 }
125 sb.append('\0');
126
127 List<String> actual = Native.toStringList(sb.toString().toCharArray());
128 assertEquals("Mismatched result size", expected.size(), actual.size());
129 for (int index = 0; index < expected.size(); index++) {
130 String expValue = expected.get(index);
131 String actValue = actual.get(index);
132 assertEquals("Mismatched value at index #" + index, expValue, actValue);
133 }
134 }
135
136 public void testDefaultStringEncoding() throws Exception {
137 final String UNICODE = "\u0444\u043b\u0441\u0432\u0443";

Callers

nothing calls this directly

Calls 7

toStringListMethod · 0.95
toCharArrayMethod · 0.80
getNameMethod · 0.65
getPackageMethod · 0.45
toStringMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected