aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2016-03-21 22:35:48 -0400
committerPaul Selkirk <paul@psgd.org>2016-03-21 22:37:53 -0400
commitcdaf07d30bd440cf3ee2f6615d044634734047bd (patch)
tree6086334b65da625dc782074064543c891dec1bfa /tests
parent46793833737e925af47e57d99bd037226d1cb2c4 (diff)
stupid fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/GNUmakefile2
-rw-r--r--tests/test-rpc_get_version.c20
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/GNUmakefile b/tests/GNUmakefile
index b4d006d..0fa6281 100644
--- a/tests/GNUmakefile
+++ b/tests/GNUmakefile
@@ -40,7 +40,7 @@ ifndef RPC_SERVER
endif
endif
ifdef RPC_CLIENT
- BIN += test-rpc_hash
+ BIN += test-rpc_hash test-rpc_get_version
endif
ifdef RPC_SERVER
BIN += test-rpc_server
diff --git a/tests/test-rpc_get_version.c b/tests/test-rpc_get_version.c
new file mode 100644
index 0000000..84869c3
--- /dev/null
+++ b/tests/test-rpc_get_version.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <assert.h>
+
+#include <hal.h>
+#include <hal_internal.h>
+
+int main (int argc, char *argv[])
+{
+ uint32_t version;
+
+#define check(op) { hal_error_t err; if ((err = (op)) != HAL_OK) { printf("%s: %s\n", #op, hal_error_string(err)); return 1; } }
+
+ check(hal_rpc_client_init());
+ check(hal_rpc_get_version(&version));
+ printf("%08x\n", version);
+
+ return 0;
+}