diff options
Diffstat (limited to 'src/junit')
4 files changed, 18 insertions, 1 deletions
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java index 92015dd..75ef808 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java @@ -77,7 +77,7 @@ public class BaseClass extends SingletonJunitCase { * ie a compilation only coverage test without functional tests. */ public void chapter__TestCoverageSignature(final Bindingtest1 binding) throws Exception { - int i; + int i = 0; final long context = 0; LongBuffer lb=null; ByteBuffer bb=null; @@ -119,6 +119,8 @@ public class BaseClass extends SingletonJunitCase { lb = binding.testFooPtr(larray, 0); lb = binding.testFooPtr(lb); + + i = binding.testDelegate(i); } { @@ -712,6 +714,11 @@ public class BaseClass extends SingletonJunitCase { Assert.assertEquals(fooLB, foo2Out); } + { + i=41; + final int iRes = binding.testDelegate(i); + Assert.assertEquals(i+1, iRes); + } } public void chapter04TestPointerBuffer(final Bindingtest1 binding) throws Exception { diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg index 29c13fa..6c516c2 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1-common.cfg @@ -46,6 +46,10 @@ Opaque long TK_Context RenameJavaSymbol DEFINE_01_EXT DEFINE_01 RenameJavaSymbol testXID_EXT testXID +DelegateImplementation testDelegate testDelegateOrigImpl +IncludeAs CustomJavaCode Bindingtest1p1Impl test1-CustomJavaCode.cfg +IncludeAs CustomJavaCode Bindingtest1p2Impl test1-CustomJavaCode.cfg + StructPackage TK_Dimension com.jogamp.gluegen.test.junit.generation EmitStruct TK_Dimension StructPackage TK_DimensionPair com.jogamp.gluegen.test.junit.generation diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c index 316603b..0683600 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c @@ -65,6 +65,10 @@ MYAPI foo MYAPIENTRY nopTest() { return 42; } +MYAPI int32_t MYAPIENTRY testDelegate(int32_t v) { + return v; +} + /** * new blob sizeof(void*) filled w/ 0xDEADBEEF */ diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h index b176f3a..6e826c5 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h @@ -111,6 +111,8 @@ MYAPI foo_ptr MYAPIENTRY testFooPtr(foo_ptr v); /** Returns 42 */ MYAPI foo MYAPIENTRY nopTest(); +MYAPI int32_t MYAPIENTRY testDelegate(int32_t v); + // // Different pointer type tests .. // |