aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-26 12:55:34 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-26 12:55:34 +0000
commit50327ce6dc622fb396f9a358fce2569481398668 (patch)
treeebed7fdd88fb7d133551d4bf2411064f642d2c76 /t
parentea2d3073ac177d95fc14c310178aa2b7455b060a (diff)
downloadtermo-50327ce6dc622fb396f9a358fce2569481398668.tar.gz
termo-50327ce6dc622fb396f9a358fce2569481398668.tar.xz
termo-50327ce6dc622fb396f9a358fce2569481398668.zip
Use termkey_new_abstract() in unit tests
Diffstat (limited to 't')
-rw-r--r--t/01base.c4
-rw-r--r--t/02getkey.c6
-rw-r--r--t/03utf8.c5
-rw-r--r--t/04flags.c5
-rw-r--r--t/10keyname.c2
-rw-r--r--t/11strfkey.c2
-rw-r--r--t/12strpkey.c2
-rw-r--r--t/13cmpkey.c2
-rw-r--r--t/20canon.c2
9 files changed, 10 insertions, 20 deletions
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 <stdio.h>
#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);