aboutsummaryrefslogtreecommitdiff
path: root/tests/01base.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-10-09 23:47:24 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-10-09 23:47:24 +0200
commit5692f32bcfa049fc2b5555b5a883045b217349b9 (patch)
tree512eaa1bece48291ffdf7cf4865a085e6ee0b2cc /tests/01base.c
parent3465d5553fbe88a75320d1da3f7228619492b036 (diff)
downloadtermo-5692f32bcfa049fc2b5555b5a883045b217349b9.tar.gz
termo-5692f32bcfa049fc2b5555b5a883045b217349b9.tar.xz
termo-5692f32bcfa049fc2b5555b5a883045b217349b9.zip
CMake-ify, rename to termkey2 for the time being
Diffstat (limited to 'tests/01base.c')
-rw-r--r--tests/01base.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/01base.c b/tests/01base.c
new file mode 100644
index 0000000..39e0e39
--- /dev/null
+++ b/tests/01base.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include "../termkey.h"
+#include "taplib.h"
+
+int
+main (int argc, char *argv[])
+{
+ termkey_t *tk;
+
+ plan_tests (6);
+
+ tk = termkey_new_abstract ("vt100", NULL, 0);
+ ok (!!tk, "termkey_new_abstract");
+ is_int (termkey_get_buffer_size (tk), 256, "termkey_get_buffer_size");
+ ok (termkey_is_started (tk), "termkey_is_started true after construction");
+
+ termkey_stop (tk);
+ ok (!termkey_is_started (tk),
+ "termkey_is_started false after termkey_stop()");
+
+ termkey_start (tk);
+ ok (termkey_is_started (tk),
+ "termkey_is_started true after termkey_start()");
+
+ termkey_destroy (tk);
+
+ ok (1, "termkey_free");
+ return exit_status ();
+}