aboutsummaryrefslogtreecommitdiff
path: root/t/10keyname.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-28 05:56:13 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-28 13:03:04 +0200
commit3465d5553fbe88a75320d1da3f7228619492b036 (patch)
treeb2086113248a918c8863dadb58a5736a2be75583 /t/10keyname.c
parent36bc6cd0952b2eddc17e7da803d85decf96d32cc (diff)
downloadtermo-3465d5553fbe88a75320d1da3f7228619492b036.tar.gz
termo-3465d5553fbe88a75320d1da3f7228619492b036.tar.xz
termo-3465d5553fbe88a75320d1da3f7228619492b036.zip
Make the tests work again
Our UTF-8 parsing now behaves differently, though.
Diffstat (limited to 't/10keyname.c')
-rw-r--r--t/10keyname.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/t/10keyname.c b/t/10keyname.c
index 0872bbc..20ac000 100644
--- a/t/10keyname.c
+++ b/t/10keyname.c
@@ -1,38 +1,40 @@
#include "../termkey.h"
#include "taplib.h"
-int main(int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
- TermKey *tk;
- TermKeySym sym;
- const char *end;
+ termkey_t *tk;
+ termkey_sym_t sym;
+ const char *end;
- plan_tests(10);
+ plan_tests (10);
- tk = termkey_new_abstract("vt100", 0);
+ tk = termkey_new_abstract ("vt100", NULL, 0);
- sym = termkey_keyname2sym(tk, "Space");
- is_int(sym, TERMKEY_SYM_SPACE, "keyname2sym Space");
+ sym = termkey_keyname2sym (tk, "Space");
+ is_int (sym, TERMKEY_SYM_SPACE, "keyname2sym Space");
- sym = termkey_keyname2sym(tk, "SomeUnknownKey");
- is_int(sym, TERMKEY_SYM_UNKNOWN, "keyname2sym SomeUnknownKey");
+ sym = termkey_keyname2sym (tk, "SomeUnknownKey");
+ is_int (sym, TERMKEY_SYM_UNKNOWN, "keyname2sym SomeUnknownKey");
- end = termkey_lookup_keyname(tk, "Up", &sym);
- ok(!!end, "termkey_get_keyname Up returns non-NULL");
- is_str(end, "", "termkey_get_keyname Up return points at endofstring");
- is_int(sym, TERMKEY_SYM_UP, "termkey_get_keyname Up yields Up symbol");
+ end = termkey_lookup_keyname (tk, "Up", &sym);
+ ok (!!end, "termkey_get_keyname Up returns non-NULL");
+ is_str (end, "", "termkey_get_keyname Up return points at endofstring");
+ is_int (sym, TERMKEY_SYM_UP, "termkey_get_keyname Up yields Up symbol");
- end = termkey_lookup_keyname(tk, "DownMore", &sym);
- ok(!!end, "termkey_get_keyname DownMore returns non-NULL");
- is_str(end, "More", "termkey_get_keyname DownMore return points at More");
- is_int(sym, TERMKEY_SYM_DOWN, "termkey_get_keyname DownMore yields Down symbol");
+ end = termkey_lookup_keyname (tk, "DownMore", &sym);
+ ok (!!end, "termkey_get_keyname DownMore returns non-NULL");
+ is_str (end, "More", "termkey_get_keyname DownMore return points at More");
+ is_int (sym, TERMKEY_SYM_DOWN,
+ "termkey_get_keyname DownMore yields Down symbol");
- end = termkey_lookup_keyname(tk, "SomeUnknownKey", &sym);
- ok(!end, "termkey_get_keyname SomeUnknownKey returns NULL");
+ end = termkey_lookup_keyname (tk, "SomeUnknownKey", &sym);
+ ok (!end, "termkey_get_keyname SomeUnknownKey returns NULL");
- is_str(termkey_get_keyname(tk, TERMKEY_SYM_SPACE), "Space", "get_keyname SPACE");
+ is_str (termkey_get_keyname (tk, TERMKEY_SYM_SPACE), "Space",
+ "get_keyname SPACE");
- termkey_destroy(tk);
-
- return exit_status();
+ termkey_destroy (tk);
+ return exit_status ();
}