From: Nick Mathewson Date: Sat, 16 Oct 2004 21:57:24 +0000 (+0000) Subject: Fix unit tests, make it compile X-Git-Tag: tor-0.0.9pre4~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25a046df7422560b16dfdb302df9621309d5fa77;p=thirdparty%2Ftor.git Fix unit tests, make it compile svn:r2543 --- diff --git a/src/or/connection.c b/src/or/connection.c index 87cb3c10d9..08bae131f5 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -329,7 +329,7 @@ static int connection_create_listener(const char *bindaddress, uint16_t bindport 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); diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 4469656b1a..6a759fdd1f 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -388,10 +388,10 @@ router_parse_routerlist_from_directory(const char *str, 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."); diff --git a/src/or/test.c b/src/or/test.c index a7b1e51eae..f317d674cd 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -661,12 +661,12 @@ test_util() { 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 @@ test_util() { 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);