aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2017-07-14 14:16:27 +0200
committerDaniel P. Berrange <berrange@redhat.com>2017-08-02 15:20:42 +0100
commit8425428e7f80bca2338a7c3d04d53d6d4acc5ed9 (patch)
treeaebfd2933af9194716dcb269f8f78a40b85bd665 /tests
parent71c60a593b571ef49ca083ef4cbc6b02eb42da59 (diff)
downloadkeycodemapdb-8425428e7f80bca2338a7c3d04d53d6d4acc5ed9.zip
keycodemapdb-8425428e7f80bca2338a7c3d04d53d6d4acc5ed9.tar.gz
keycodemapdb-8425428e7f80bca2338a7c3d04d53d6d4acc5ed9.tar.bz2
Add tests for name-map
Signed-off-by: Pierre Ossman <ossman@cendio.se>
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore1
-rw-r--r--tests/Makefile13
-rw-r--r--tests/stdc++.cc5
-rw-r--r--tests/stdc.c5
-rw-r--r--tests/test.py3
5 files changed, 24 insertions, 3 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index d7e92ec..ab726e7 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,4 +1,5 @@
osx2win32.*
+osx2win32_name.*
osx.*
stdc
stdc++
diff --git a/tests/Makefile b/tests/Makefile
index af02ee2..3f3d901 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -13,27 +13,34 @@ SOURCES := $(GEN) $(DATA)
.DELETE_ON_ERROR:
-stdc: stdc.c osx2win32.h osx.h
+stdc: stdc.c osx2win32.h osx2win32_name.h osx.h
$(CC) -o $@ $^
osx2win32.h: $(SOURCES)
$(GEN) --lang stdc code-map $(DATA) osx win32 > $@
+osx2win32_name.h: $(SOURCES)
+ $(GEN) --lang stdc name-map $(DATA) osx win32 > $@
osx.h: $(SOURCES)
$(GEN) --lang stdc code-table $(DATA) osx > $@
-stdc++: stdc++.cc osx2win32.hh osx.hh
+stdc++: stdc++.cc osx2win32.hh osx2win32_name.hh osx.hh
$(CC) -o $@ $^
osx2win32.hh: $(SOURCES)
$(GEN) --lang stdc++ code-map $(DATA) osx win32 > $@
+osx2win32_name.hh: $(SOURCES)
+ $(GEN) --lang stdc++ name-map $(DATA) osx win32 > $@
osx.hh: $(SOURCES)
$(GEN) --lang stdc++ code-table $(DATA) osx > $@
-python2: osx2win32.py osx.py
+python2: osx2win32.py osx2win32_name.py osx.py
osx2win32.py: $(SOURCES)
$(GEN) --lang python2 code-map $(DATA) osx win32 > $@
+osx2win32_name.py: $(SOURCES)
+ $(GEN) --lang python2 name-map $(DATA) osx win32 > $@
osx.py: $(SOURCES)
$(GEN) --lang python2 code-table $(DATA) osx > $@
clean:
rm -f osx2win32.*
+ rm -f osx2win32_name.*
rm -f osx.*
rm -f stdc stdc++
diff --git a/tests/stdc++.cc b/tests/stdc++.cc
index 251bb84..6ec846a 100644
--- a/tests/stdc++.cc
+++ b/tests/stdc++.cc
@@ -8,12 +8,17 @@
*/
#include <assert.h>
+#include <string.h>
+
#include "osx2win32.hh"
+#include "osx2win32_name.hh"
#include "osx.hh"
int main(int argc, char** argv)
{
assert(code_map_osx_to_win32[0x1d] == 0x30);
+ assert(strcmp(name_map_osx_to_win32[0x1d], "VK_0") == 0);
+
assert(code_table_osx[0x1d] == 0x3b);
return 0;
diff --git a/tests/stdc.c b/tests/stdc.c
index 2e880da..d41b67e 100644
--- a/tests/stdc.c
+++ b/tests/stdc.c
@@ -8,12 +8,17 @@
*/
#include <assert.h>
+#include <string.h>
+
#include "osx2win32.h"
+#include "osx2win32_name.h"
#include "osx.h"
int main(int argc, char** argv)
{
assert(code_map_osx_to_win32[0x1d] == 0x30);
+ assert(strcmp(name_map_osx_to_win32[0x1d], "VK_0") == 0);
+
assert(code_table_osx[0x1d] == 0x3b);
return 0;
diff --git a/tests/test.py b/tests/test.py
index 6577115..652ddf7 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -6,7 +6,10 @@
# and 3-clause BSD licenses.
import osx2win32
+import osx2win32_name
import osx
assert osx2win32.code_map_osx_to_win32[0x1d] == 0x30
+assert osx2win32_name.name_map_osx_to_win32[0x1d] == "VK_0"
+
assert osx.code_table_osx[0x1d] == 0x3b;