-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set first variadic argument in varargs functions, and refactor/cleanu…
…p the VarargsInvoker. Fixes #120
- Loading branch information
Showing
2 changed files
with
73 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
modules/glib/src/test/java/io/github/jwharm/javagi/test/glib/VarargsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.jwharm.javagi.test.glib; | ||
|
||
import org.gnome.glib.GLib; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
/** | ||
* Test calling a variadic function | ||
*/ | ||
public class VarargsTest { | ||
|
||
@Test | ||
void testVarargs() { | ||
var str = GLib.strdupPrintf("%s %d %.2f %c", "abc", 123, 4.56f, 'c'); | ||
assertEquals("abc 123 4,56 c", str); | ||
} | ||
} |