[or-cvs] Fix unit tests, make it compile

Nick Mathewson nickm at seul.org
Sat Oct 16 21:57:27 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv24738/src/or

Modified Files:
	connection.c routerparse.c test.c 
Log Message:
Fix unit tests, make it compile

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -d -r1.264 -r1.265
--- connection.c	16 Oct 2004 21:53:29 -0000	1.264
+++ connection.c	16 Oct 2004 21:57:24 -0000	1.265
@@ -329,7 +329,7 @@
   
   if (usePort==0)
     usePort = bindport;
-  binaddrr.sin_addr.s_addr = htonl(addr);
+  bindaddr.sin_addr.s_addr = htonl(addr);
   bindaddr.sin_family = AF_INET;
   bindaddr.sin_port = htons((uint16_t) usePort);
 

Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerparse.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- routerparse.c	16 Oct 2004 21:42:09 -0000	1.59
+++ routerparse.c	16 Oct 2004 21:57:24 -0000	1.60
@@ -388,10 +388,10 @@
     goto err;
   }
   if (tok->n_args > 1) {
-    log_fn(LOG_WARN, "Invalid recommended-software line", tok->n_args);goto err;
+    log_fn(LOG_WARN, "Invalid recommended-software line");goto err;
            
   }
-  versions = tor->n_args ? tor_strdup(tok->args[0]) : tor_strdup("");
+  versions = tok->n_args ? tor_strdup(tok->args[0]) : tor_strdup("");
 
   if (!(tok = find_first_by_keyword(tokens, K_RUNNING_ROUTERS))) {
     log_fn(LOG_WARN, "Missing running-routers line from directory.");

Index: test.c
===================================================================
RCS file: /home/or/cvsroot/src/or/test.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- test.c	14 Oct 2004 19:51:47 -0000	1.128
+++ test.c	16 Oct 2004 21:57:24 -0000	1.129
@@ -661,12 +661,12 @@
   cp = NULL; u32 = 3; u16 = 3;
   test_assert(!parse_addr_port("1.2.3.4", &cp, &u32, &u16));
   test_streq(cp, "1.2.3.4");
-  test_eq(u32, htonl(0x01020304u));
+  test_eq(u32, 0x01020304u);
   test_eq(u16, 0);
   tor_free(cp);
   test_assert(!parse_addr_port("4.3.2.1:99", &cp, &u32, &u16));
   test_streq(cp, "4.3.2.1");
-  test_eq(u32, htonl(0x04030201u));
+  test_eq(u32, 0x04030201u);
   test_eq(u16, 99);
   tor_free(cp);
   test_assert(!parse_addr_port("nonexistent.address:4040", &cp, NULL, &u16));
@@ -675,13 +675,13 @@
   tor_free(cp);
   test_assert(!parse_addr_port("localhost:9999", &cp, &u32, &u16));
   test_streq(cp, "localhost");
-  test_eq(u32, htonl(0x7f000001u));
+  test_eq(u32, 0x7f000001u);
   test_eq(u16, 9999);
   tor_free(cp);
   u32 = 3;
   test_assert(!parse_addr_port("localhost", NULL, &u32, &u16));
   test_eq(cp, NULL);
-  test_eq(u32, htonl(0x7f000001u));
+  test_eq(u32, 0x7f000001u);
   test_eq(u16, 0);
   tor_free(cp);
 



More information about the tor-commits mailing list