summaryrefslogtreecommitdiff
path: root/n/avr/modules/host/test/test_host.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/modules/host/test/test_host.c')
-rw-r--r--n/avr/modules/host/test/test_host.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/n/avr/modules/host/test/test_host.c b/n/avr/modules/host/test/test_host.c
index 3b839dd..db8161f 100644
--- a/n/avr/modules/host/test/test_host.c
+++ b/n/avr/modules/host/test/test_host.c
@@ -1,7 +1,7 @@
/* test_host.c */
/* avr.host - Host fonctions modules. {{{
*
- * Copyright (C) 2005 Nicolas Schodet
+ * Copyright (C) 2005-2006 Nicolas Schodet
*
* Robot APB Team/Efrei 2006.
* Web: http://assos.efrei.fr/robot/
@@ -26,24 +26,30 @@
#include "modules/host/host.h"
#include <string.h>
-#include <assert.h>
#include <stdio.h>
int
-main (void)
+main (int argc, char **argv)
{
- int i = host_fetch_integer ("avr_integer");
- const char *s = host_fetch_string ("avr_string");
+ int i;
+ const char *s;
printf ("reset\n");
+ host_init (argc, argv);
+ i = host_fetch_integer ("avr_integer");
+ s = host_fetch_string ("avr_string");
if (i != -1)
{
printf ("get\n");
+ assert_print (argc == 2 && strcmp (argv[1], "ni") == 0,
+ "argument passing not working");
assert (i == 42);
assert (strcmp (s, "Ni!") == 0);
}
else
{
printf ("set\n");
+ assert_print (argc == 2 && strcmp (argv[1], "ni") == 0,
+ "please provide \"ni\" as the first argument");
host_register_integer ("avr_integer", 42);
host_register_string ("avr_string", "Ni!");
host_reset ();