summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-10-29 01:00:27 +0200
committerRan Benita <ran234@gmail.com>2012-10-29 01:20:04 +0200
commit7261f404d201b157dc0ce1ae0386fd74f3a128a7 (patch)
treefbd0cf78ce7ace10dc1f79042163be0ab0b3528a /test
parenta51ee70419cf492a46020123294c7f708c81070d (diff)
state, context: allow passing NULL to *_unref()
For error handling code, it's nice to be able to pass NULL to these function without worrying about segfaults ensuing. free() sets the precedent here. Also document this fact. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/state.c b/test/state.c
index d23b94c..83a8f45 100644
--- a/test/state.c
+++ b/test/state.c
@@ -339,6 +339,11 @@ main(void)
assert(context);
+ /* Make sure these are allowed. */
+ xkb_context_unref(NULL);
+ xkb_keymap_unref(NULL);
+ xkb_state_unref(NULL);
+
keymap = test_compile_rules(context, "evdev", "pc104", "us,ru", NULL, "grp:menu_toggle");
assert(keymap);