Imported Upstream version 2.0.90
[platform/upstream/kbd.git] / tests / libkbdfile-test09.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <error.h>
5 #include <errno.h>
6
7 #include <kbdfile.h>
8
9 int
10 main(void)
11 {
12         struct kbdfile *fp = kbdfile_open(NULL, DATADIR "/findfile/test_0/keymaps/i386/qwerty/test0.map");
13         if (!fp)
14                 error(EXIT_FAILURE, 0, "unable to create kbdfile");
15
16         const char *expect = DATADIR "/findfile/test_0/keymaps/i386/qwerty/test0.map";
17         if (strcmp(expect, kbdfile_get_pathname(fp)) != 0)
18                 error(EXIT_FAILURE, 0, "unexpected file: %s (expected %s)", kbdfile_get_pathname(fp), expect);
19
20         kbdfile_free(fp);
21
22         return EXIT_SUCCESS;
23 }