diff options
Diffstat (limited to 'src/junit/com/jogamp/gluegen')
3 files changed, 42 insertions, 0 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 79af1b7..900d959 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java @@ -1011,5 +1011,29 @@ public class BaseClass extends JunitTracer { System.err.println("ch11.3: sameInstanceByRef "+sameInstanceByRef); Assert.assertFalse(sameInstanceByVal); Assert.assertFalse(sameInstanceByRef); + + final TK_Dimension dim2 = binding.getBoundsValue(1, 2, 3, 4); + final TK_Dimension[] sumands = { dim1, dim2 }; + final TK_Dimension dimSum = binding.addDimensions(sumands); + { + dumpDim("ch11.4: sum-dim ", dimSum); + Assert.assertEquals(11+1, dimSum.getX()); + Assert.assertEquals(22+2, dimSum.getY()); + Assert.assertEquals(33+3, dimSum.getWidth()); + Assert.assertEquals(44+4, dimSum.getHeight()); + } + binding.zeroDimensions(sumands); + { + dumpDim("ch11.5: zero-dim[0] ", sumands[0]); + dumpDim("ch11.5: zero-dim[1] ", sumands[1]); + Assert.assertEquals(0, sumands[0].getX()); + Assert.assertEquals(0, sumands[0].getY()); + Assert.assertEquals(0, sumands[0].getWidth()); + Assert.assertEquals(0, sumands[0].getHeight()); + Assert.assertEquals(0, sumands[1].getX()); + Assert.assertEquals(0, sumands[1].getY()); + Assert.assertEquals(0, sumands[1].getWidth()); + Assert.assertEquals(0, sumands[1].getHeight()); + } } } 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 9b2fb2d..ca24444 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c @@ -528,3 +528,18 @@ MYAPI Bool MYAPIENTRY isSameInstanceByVal(TK_Dimension s1, TK_Dimension s2) { MYAPI Bool MYAPIENTRY isSameInstanceByRef(const TK_Dimension *s1, const TK_Dimension *s2) { return s1 == s2; } +MYAPI TK_Dimension MYAPIENTRY addDimensions(const TK_Dimension s[2]) { + TK_Dimension r = { s[0].x + s[1].x, s[0].y + s[1].y, + s[0].width + s[1].width, s[0].height + s[1].height }; + return r; +} +MYAPI void MYAPIENTRY zeroDimensions(TK_Dimension s[2]) { + s[0].x = 0; + s[0].y = 0; + s[0].width = 0; + s[0].height = 0; + s[1].x = 0; + s[1].y = 0; + s[1].width = 0; + s[1].height = 0; +} 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 779e65d..a487f7a 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h @@ -250,3 +250,6 @@ MYAPI TK_Surface MYAPIENTRY getSurfaceValue(TK_Dimension bounds); MYAPI TK_Dimension MYAPIENTRY getSurfaceBoundsValue(TK_Surface s); MYAPI Bool MYAPIENTRY isSameInstanceByVal(TK_Dimension s1, TK_Dimension s2); MYAPI Bool MYAPIENTRY isSameInstanceByRef(const TK_Dimension *s1, const TK_Dimension *s2); +MYAPI TK_Dimension MYAPIENTRY addDimensions(const TK_Dimension s[2]); +MYAPI void MYAPIENTRY zeroDimensions(TK_Dimension s[2]); + |