aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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;
+}