aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/fakekey-test.c38
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..67ed38b
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,5 @@
+INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(FAKEKEY_CFLAGS)
+
+noinst_PROGRAMS=fakekey-test
+
+fakekey_test_LDADD=../src/libfakekey.la \ No newline at end of file
diff --git a/tests/fakekey-test.c b/tests/fakekey-test.c
new file mode 100644
index 0000000..9d807b6
--- /dev/null
+++ b/tests/fakekey-test.c
@@ -0,0 +1,38 @@
+#include "fakekey/fakekey.h"
+
+int
+main(int argc, char **argv)
+{
+ Display *dpy;
+ FakeKey *fk;
+ int i;
+ unsigned char str[] = "hello HELLO worldly world", *p = NULL;
+ unsigned char str2[] = "\303\270";
+
+ if ((dpy = XOpenDisplay(NULL)) == NULL)
+ {
+ fprintf(stderr,"Failed to open display\n");
+ exit(1);
+ }
+
+ fk = fakekey_init(dpy);
+
+ p = str;
+
+ /*
+ for (i=0; i<10; i++)
+ {
+ fakekey_press(fk, str2, 2, 0);
+ fakekey_release(fk);
+ }
+ */
+
+ while (*p != '\0')
+ {
+ fakekey_press(fk, p, 1, 0);
+ fakekey_release(fk);
+ p++;
+ }
+
+
+}