aboutsummaryrefslogtreecommitdiff
path: root/tests/02getkey.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-10-14 00:24:47 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-10-14 00:24:47 +0200
commit77878abe90a3bec0055faf6bd6e4871cc6f1a474 (patch)
tree02d281593addcb5232540781c02c6a8454ae1494 /tests/02getkey.c
parente98d9c0fd1a148adc844046d568d40de135fb366 (diff)
downloadtermo-77878abe90a3bec0055faf6bd6e4871cc6f1a474.tar.gz
termo-77878abe90a3bec0055faf6bd6e4871cc6f1a474.tar.xz
termo-77878abe90a3bec0055faf6bd6e4871cc6f1a474.zip
Renaming continued
Diffstat (limited to 'tests/02getkey.c')
-rw-r--r--tests/02getkey.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/tests/02getkey.c b/tests/02getkey.c
index 8cba991..94f71c7 100644
--- a/tests/02getkey.c
+++ b/tests/02getkey.c
@@ -1,92 +1,92 @@
-#include "../termkey.h"
+#include "../termo.h"
#include "taplib.h"
int
main (int argc, char *argv[])
{
- termkey_t *tk;
- termkey_key_t key;
+ termo_t *tk;
+ termo_key_t key;
plan_tests (31);
- tk = termkey_new_abstract ("vt100", NULL, 0);
+ tk = termo_new_abstract ("vt100", NULL, 0);
- is_int (termkey_get_buffer_remaining (tk),
+ is_int (termo_get_buffer_remaining (tk),
256, "buffer free initially 256");
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_NONE,
+ is_int (termo_getkey (tk, &key), TERMO_RES_NONE,
"getkey yields RES_NONE when empty");
- is_int (termkey_push_bytes (tk, "h", 1), 1, "push_bytes returns 1");
+ is_int (termo_push_bytes (tk, "h", 1), 1, "push_bytes returns 1");
- is_int (termkey_get_buffer_remaining (tk), 255,
+ is_int (termo_get_buffer_remaining (tk), 255,
"buffer free 255 after push_bytes");
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
"getkey yields RES_KEY after h");
- is_int (key.type, TERMKEY_TYPE_KEY, "key.type after h");
+ is_int (key.type, TERMO_TYPE_KEY, "key.type after h");
is_int (key.code.codepoint, 'h', "key.code.codepoint after h");
is_int (key.modifiers, 0, "key.modifiers after h");
is_str (key.multibyte, "h", "key.multibyte after h");
- is_int (termkey_get_buffer_remaining (tk), 256,
+ is_int (termo_get_buffer_remaining (tk), 256,
"buffer free 256 after getkey");
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_NONE,
+ is_int (termo_getkey (tk, &key), TERMO_RES_NONE,
"getkey yields RES_NONE a second time");
- termkey_push_bytes (tk, "\x01", 1);
+ termo_push_bytes (tk, "\x01", 1);
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
"getkey yields RES_KEY after C-a");
- is_int (key.type, TERMKEY_TYPE_KEY, "key.type after C-a");
+ is_int (key.type, TERMO_TYPE_KEY, "key.type after C-a");
is_int (key.code.codepoint, 'a', "key.code.codepoint after C-a");
- is_int (key.modifiers, TERMKEY_KEYMOD_CTRL, "key.modifiers after C-a");
+ is_int (key.modifiers, TERMO_KEYMOD_CTRL, "key.modifiers after C-a");
- termkey_push_bytes (tk, "\033OA", 3);
+ termo_push_bytes (tk, "\033OA", 3);
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
"getkey yields RES_KEY after Up");
- is_int (key.type, TERMKEY_TYPE_KEYSYM, "key.type after Up");
- is_int (key.code.sym, TERMKEY_SYM_UP, "key.code.sym after Up");
+ is_int (key.type, TERMO_TYPE_KEYSYM, "key.type after Up");
+ is_int (key.code.sym, TERMO_SYM_UP, "key.code.sym after Up");
is_int (key.modifiers, 0, "key.modifiers after Up");
- is_int (termkey_push_bytes (tk, "\033O", 2), 2, "push_bytes returns 2");
+ is_int (termo_push_bytes (tk, "\033O", 2), 2, "push_bytes returns 2");
- is_int (termkey_get_buffer_remaining (tk), 254,
+ is_int (termo_get_buffer_remaining (tk), 254,
"buffer free 254 after partial write");
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_AGAIN,
+ is_int (termo_getkey (tk, &key), TERMO_RES_AGAIN,
"getkey yields RES_AGAIN after partial write");
- termkey_push_bytes (tk, "C", 1);
+ termo_push_bytes (tk, "C", 1);
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
"getkey yields RES_KEY after Right completion");
- is_int (key.type, TERMKEY_TYPE_KEYSYM, "key.type after Right");
- is_int (key.code.sym, TERMKEY_SYM_RIGHT, "key.code.sym after Right");
+ is_int (key.type, TERMO_TYPE_KEYSYM, "key.type after Right");
+ is_int (key.code.sym, TERMO_SYM_RIGHT, "key.code.sym after Right");
is_int (key.modifiers, 0, "key.modifiers after Right");
- is_int (termkey_get_buffer_remaining (tk), 256,
+ is_int (termo_get_buffer_remaining (tk), 256,
"buffer free 256 after completion");
- termkey_push_bytes (tk, "\033[27;5u", 7);
+ termo_push_bytes (tk, "\033[27;5u", 7);
- is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
"getkey yields RES_KEY after Ctrl-Escape");
- is_int (key.type, TERMKEY_TYPE_KEYSYM,
+ is_int (key.type, TERMO_TYPE_KEYSYM,
"key.type after Ctrl-Escape");
- is_int (key.code.sym, TERMKEY_SYM_ESCAPE,
+ is_int (key.code.sym, TERMO_SYM_ESCAPE,
"key.code.sym after Ctrl-Escape");
- is_int (key.modifiers, TERMKEY_KEYMOD_CTRL,
+ is_int (key.modifiers, TERMO_KEYMOD_CTRL,
"key.modifiers after Ctrl-Escape");
- termkey_destroy (tk);
+ termo_destroy (tk);
return exit_status ();
}