From 50327ce6dc622fb396f9a358fce2569481398668 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Thu, 26 Jan 2012 12:55:34 +0000 Subject: Use termkey_new_abstract() in unit tests --- t/01base.c | 4 ++-- t/02getkey.c | 6 +----- t/03utf8.c | 5 +---- t/04flags.c | 5 +---- t/10keyname.c | 2 +- t/11strfkey.c | 2 +- t/12strpkey.c | 2 +- t/13cmpkey.c | 2 +- t/20canon.c | 2 +- 9 files changed, 10 insertions(+), 20 deletions(-) (limited to 't') diff --git a/t/01base.c b/t/01base.c index 88e2c84..3f7ef13 100644 --- a/t/01base.c +++ b/t/01base.c @@ -8,9 +8,9 @@ int main(int argc, char *argv[]) plan_tests(2); - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); - ok(!!tk, "termkey_new"); + ok(!!tk, "termkey_new_abstract"); termkey_destroy(tk); diff --git a/t/02getkey.c b/t/02getkey.c index d5c26fd..f2bd299 100644 --- a/t/02getkey.c +++ b/t/02getkey.c @@ -1,4 +1,3 @@ -#include #include "../termkey.h" #include "taplib.h" @@ -9,10 +8,7 @@ int main(int argc, char *argv[]) plan_tests(27); - /* Sanitise this just in case */ - putenv("TERM=vt100"); - - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); is_int(termkey_get_buffer_remaining(tk), 256, "buffer free initially 256"); diff --git a/t/03utf8.c b/t/03utf8.c index bb97328..bf41d50 100644 --- a/t/03utf8.c +++ b/t/03utf8.c @@ -8,10 +8,7 @@ int main(int argc, char *argv[]) plan_tests(57); - /* Sanitise this just in case */ - putenv("TERM=vt100"); - - tk = termkey_new(-1, TERMKEY_FLAG_UTF8); + tk = termkey_new_abstract("vt100", TERMKEY_FLAG_UTF8); termkey_push_bytes(tk, "a", 1); diff --git a/t/04flags.c b/t/04flags.c index d803be8..1c66c93 100644 --- a/t/04flags.c +++ b/t/04flags.c @@ -9,10 +9,7 @@ int main(int argc, char *argv[]) plan_tests(8); - /* Sanitise this just in case */ - putenv("TERM=vt100"); - - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); termkey_push_bytes(tk, " ", 1); diff --git a/t/10keyname.c b/t/10keyname.c index 7a35ad7..feedbc4 100644 --- a/t/10keyname.c +++ b/t/10keyname.c @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) plan_tests(10); - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); sym = termkey_keyname2sym(tk, "Space"); is_int(sym, TERMKEY_SYM_SPACE, "keyname2sym Space"); diff --git a/t/11strfkey.c b/t/11strfkey.c index 67208a7..bea3a22 100644 --- a/t/11strfkey.c +++ b/t/11strfkey.c @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) plan_tests(28); - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); key.type = TERMKEY_TYPE_UNICODE; key.code.codepoint = 'A'; diff --git a/t/12strpkey.c b/t/12strpkey.c index f591d9b..cb3d3c0 100644 --- a/t/12strpkey.c +++ b/t/12strpkey.c @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) plan_tests(53); - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); CLEAR_KEY; endp = termkey_strpkey(tk, "A", &key, 0); diff --git a/t/13cmpkey.c b/t/13cmpkey.c index 13ff313..88431ea 100644 --- a/t/13cmpkey.c +++ b/t/13cmpkey.c @@ -8,7 +8,7 @@ int main(int argc, char *argv[]) plan_tests(12); - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); key1.type = TERMKEY_TYPE_UNICODE; key1.code.codepoint = 'A'; diff --git a/t/20canon.c b/t/20canon.c index ec6de1f..8d7b6ad 100644 --- a/t/20canon.c +++ b/t/20canon.c @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) plan_tests(26); - tk = termkey_new(-1, 0); + tk = termkey_new_abstract("vt100", 0); CLEAR_KEY; endp = termkey_strpkey(tk, " ", &key, 0); -- cgit v1.2.3-70-g09d2