aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_stub_hints.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-05-03 15:47:54 -0400
committerDavid Robillard <d@drobilla.net>2021-05-03 18:30:39 -0400
commit931490c28a52d83ffc7fd9fc8c6e04349f4d63b1 (patch)
tree08e22505ad8d8dbd6c0b731eaa41657a71222f69 /test/test_stub_hints.c
parentb483856ff188041f58a934c32c963cb49416a52d (diff)
downloadpugl-931490c28a52d83ffc7fd9fc8c6e04349f4d63b1.tar.gz
pugl-931490c28a52d83ffc7fd9fc8c6e04349f4d63b1.tar.bz2
pugl-931490c28a52d83ffc7fd9fc8c6e04349f4d63b1.zip
Improve test coverage
Diffstat (limited to 'test/test_stub_hints.c')
-rw-r--r--test/test_stub_hints.c18
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);