summaryrefslogtreecommitdiff
path: root/test/filecomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/filecomp.c')
-rw-r--r--test/filecomp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/filecomp.c b/test/filecomp.c
index 0c1111a..0e41dea 100644
--- a/test/filecomp.c
+++ b/test/filecomp.c
@@ -38,7 +38,7 @@ test_file(struct xkb_context *ctx, const char *path_rel)
int
main(void)
{
- struct xkb_context *ctx = test_get_context();
+ struct xkb_context *ctx = test_get_context(0);
assert(test_file(ctx, "keymaps/basic.xkb"));
assert(test_file(ctx, "keymaps/comprehensive-plus-geom.xkb"));
@@ -48,6 +48,15 @@ main(void)
assert(!test_file(ctx, "keymaps/bad.xkb"));
assert(!test_file(ctx, "does not exist"));
+ /* Test response to invalid flags and formats. */
+ fclose(stdin);
+ assert(!xkb_keymap_new_from_file(ctx, NULL, XKB_KEYMAP_FORMAT_TEXT_V1, 0));
+ assert(!xkb_keymap_new_from_file(ctx, stdin, 0, 0));
+ assert(!xkb_keymap_new_from_file(ctx, stdin, XKB_KEYMAP_USE_ORIGINAL_FORMAT, 0));
+ assert(!xkb_keymap_new_from_file(ctx, stdin, 1234, 0));
+ assert(!xkb_keymap_new_from_file(ctx, stdin, XKB_KEYMAP_FORMAT_TEXT_V1, -1));
+ assert(!xkb_keymap_new_from_file(ctx, stdin, XKB_KEYMAP_FORMAT_TEXT_V1, 1234));
+
xkb_context_unref(ctx);
return 0;