diff options
Diffstat (limited to 'src/junit')
3 files changed, 33 insertions, 3 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 4673805..8d9c73a 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/BaseClass.java @@ -685,10 +685,34 @@ public class BaseClass extends JunitTracer { TK_Surface surface = binding.createSurface(); - assertAPTR(0x123456789abcdef0L, surface.getCtx()); + final long surfaceContext = surface.getCtx(); + assertAPTR(0x123456789abcdef0L, surfaceContext); + + TK_ContextWrapper ctxWrapper = surface.getCtxWrapper(); + final long wrapperContext = ctxWrapper.getCtx(); + assertAPTR(0xA23456781abcdef0L, wrapperContext); TK_Engine engine = surface.getEngine(); - assertAPTR(0x123456789abcdef0L, engine.getCtx()); + final long engineContext = engine.getCtx(); + assertAPTR(0xB23456782abcdef0L, engineContext); + Assert.assertEquals(0x0111, engine.render(0x0100, 0x0010, 0x0001)); + + surface.setCtx(surfaceContext); + assertAPTR(surfaceContext, surface.getCtx()); + assertAPTR(wrapperContext, ctxWrapper.getCtx()); + assertAPTR(engineContext, engine.getCtx()); + Assert.assertEquals(0x0111, engine.render(0x0100, 0x0010, 0x0001)); + + ctxWrapper.setCtx(wrapperContext); + assertAPTR(surfaceContext, surface.getCtx()); + assertAPTR(wrapperContext, ctxWrapper.getCtx()); + assertAPTR(engineContext, engine.getCtx()); + Assert.assertEquals(0x0111, engine.render(0x0100, 0x0010, 0x0001)); + + engine.setCtx(engineContext); + assertAPTR(surfaceContext, surface.getCtx()); + assertAPTR(wrapperContext, ctxWrapper.getCtx()); + assertAPTR(engineContext, engine.getCtx()); Assert.assertEquals(0x0111, engine.render(0x0100, 0x0010, 0x0001)); TK_Dimension dimension = surface.getBounds(); 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 ae3c8a5..ebb1e08 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.c @@ -259,10 +259,11 @@ MYAPI TK_Surface * MYAPIENTRY createSurface() { s->getClip = _TK_getClip; s->ctx = (void *) 0x123456789abcdef0UL; + s->ctxWrapper.ctx = (void *) 0xA23456781abcdef0UL; //s->engine = (TK_Engine *) calloc(1, sizeof(TK_Engine)); //s->engine->ctx = (void *) 0x123456789abcdef0UL; //s->engine->render = _TK_render; - s->engine.ctx = (void *) 0x123456789abcdef0UL; + s->engine.ctx = (void *) 0xB23456782abcdef0UL; s->engine.render = _TK_render; s->bounds.x = 0x11111111U; 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 6c38a03..76a15f2 100644 --- a/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h +++ b/src/junit/com/jogamp/gluegen/test/junit/generation/test1.h @@ -143,8 +143,13 @@ typedef struct { int32_t (MYAPIENTRY *render) (int x, int y, int ps); } TK_Engine; +typedef struct { + TK_Context ctx; +} TK_ContextWrapper; + typedef struct tk_Surface { TK_Context ctx; + TK_ContextWrapper ctxWrapper; // const TK_Engine * engine; TK_Engine engine; TK_Dimension bounds; |