()
| 375 | } |
| 376 | |
| 377 | public void testToByteArray() { |
| 378 | final String VALUE = getName(); |
| 379 | byte[] buf = Native.toByteArray(VALUE); |
| 380 | assertEquals("Wrong byte array length", VALUE.getBytes().length+1, buf.length); |
| 381 | assertEquals("Missing NUL terminator", (byte)0, buf[buf.length-1]); |
| 382 | assertEquals("Wrong byte array contents", VALUE, new String(buf, 0, buf.length-1)); |
| 383 | } |
| 384 | |
| 385 | public void testToByteArrayWithEncoding() throws Exception { |
| 386 | final String ENCODING = "utf8"; |
nothing calls this directly
no test coverage detected