diff options
Diffstat (limited to 'test/test_stub_hints.c')
-rw-r--r-- | test/test_stub_hints.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_stub_hints.c b/test/test_stub_hints.c index 1cc1180..75c8052 100644 --- a/test/test_stub_hints.c +++ b/test/test_stub_hints.c @@ -55,6 +55,21 @@ main(void) assert(!puglSetViewHint(view, PUGL_ALPHA_BITS, PUGL_DONT_CARE)); assert(!puglSetViewHint(view, PUGL_REFRESH_RATE, PUGL_DONT_CARE)); + // Check failure to set PUGL_DONT_CARE for hints that don't support it + assert(puglSetViewHint(view, PUGL_USE_COMPAT_PROFILE, PUGL_DONT_CARE) == + PUGL_BAD_PARAMETER); + assert(puglSetViewHint(view, PUGL_USE_DEBUG_CONTEXT, PUGL_DONT_CARE) == + PUGL_BAD_PARAMETER); + assert(puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, PUGL_DONT_CARE) == + PUGL_BAD_PARAMETER); + assert(puglSetViewHint(view, PUGL_CONTEXT_VERSION_MINOR, PUGL_DONT_CARE) == + PUGL_BAD_PARAMETER); + assert(puglSetViewHint(view, PUGL_SWAP_INTERVAL, PUGL_DONT_CARE) == + PUGL_BAD_PARAMETER); + + // Check failure to set out of range hints + assert(puglSetViewHint(view, (PuglViewHint)999, 1) == PUGL_BAD_PARAMETER); + // Realize view and print all hints for debugging convenience assert(!puglRealize(view)); printViewHints(view); @@ -72,6 +87,9 @@ main(void) assert(puglGetViewHint(view, PUGL_IGNORE_KEY_REPEAT) != PUGL_DONT_CARE); assert(puglGetViewHint(view, PUGL_REFRESH_RATE) != PUGL_DONT_CARE); + // Check failure to get out of range hints + assert(puglGetViewHint(view, (PuglViewHint)999) == PUGL_DONT_CARE); + // Tear down puglFreeView(view); puglFreeWorld(world); |