Skip to content

Commit

Permalink
Test varargs form with no type
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jan 5, 2022
1 parent 505374e commit e48075b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/java/jnr/ffi/VarargsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public static void tearDownClass() throws Exception {
assertEquals("12345", result);
}

@Test public void testSizeTNoType() {
Pointer ptr = Runtime.getRuntime(c).getMemoryManager().allocate(5000);
int size = c.snprintf(ptr, 5000, "%zu", 12345L);
assertEquals(5, size);
String result = ptr.getString(0, size, Charset.defaultCharset());
assertEquals("12345", result);
}

@Test public void testSizeTNoVarargs() {
Pointer ptr = Runtime.getRuntime(c).getMemoryManager().allocate(5000);
int size = c.snprintf(ptr, 5000, "%zu", 12345);
Expand Down

0 comments on commit e48075b

Please sign in to comment.