diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_redisplay.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test_redisplay.c b/test/test_redisplay.c index fe3bc6b..60dd219 100644 --- a/test/test_redisplay.c +++ b/test/test_redisplay.c @@ -29,7 +29,8 @@ static const double timeout = -1.0; X(EXPOSED) \ X(SHOULD_REDISPLAY) \ X(POSTED_REDISPLAY) \ - X(REDISPLAYED) + X(REDISPLAYED) \ + X(REREDISPLAYED) #define X(state) state, @@ -82,6 +83,8 @@ onEvent(PuglView* view, const PuglEvent* event) (event->expose.y + event->expose.height >= redisplayRect.y + redisplayRect.height)) { test->state = REDISPLAYED; + } else if (test->state == REDISPLAYED) { + test->state = REREDISPLAYED; } break; @@ -136,6 +139,12 @@ main(int argc, char** argv) assert(test.state != POSTED_REDISPLAY); } + // Redisplay from outside the event handler + puglPostRedisplay(test.view); + while (test.state != REREDISPLAYED) { + assert(!puglUpdate(test.world, timeout)); + } + // Tear down puglFreeView(test.view); puglFreeWorld(test.world); |