[or-cvs] Make unittests pass again.

Nick Mathewson nickm at seul.org
Tue Jan 10 20:47:27 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv24867/src/or

Modified Files:
	test.c 
Log Message:
Make unittests pass again.

Index: test.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/test.c,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -p -d -r1.216 -r1.217
--- test.c	14 Dec 2005 20:40:40 -0000	1.216
+++ test.c	10 Jan 2006 20:47:24 -0000	1.217
@@ -1138,7 +1138,6 @@ test_dir_format(void)
   char buf[8192], buf2[8192];
   char platform[256];
   char fingerprint[FINGERPRINT_LEN+1];
-  char d[DIGEST_LEN];
   char *pk1_str = NULL, *pk2_str = NULL, *pk3_str = NULL, *cp;
   size_t pk1_str_len, pk2_str_len, pk3_str_len;
   routerinfo_t r1, r2;
@@ -1148,7 +1147,6 @@ test_dir_format(void)
   routerlist_t *dir1 = NULL, *dir2 = NULL;
   tor_version_t ver1;
   char *bw_lines = NULL;
-  const char *m;
 
   test_assert( (pk1 = crypto_new_pk_env()) );
   test_assert( (pk2 = crypto_new_pk_env()) );
@@ -1309,6 +1307,11 @@ test_dir_format(void)
     crypto_pk_get_fingerprint(pk1, buf, 1);
     add_fingerprint_to_dir("Fred", buf, fingerprint_list);
   }
+#if 0
+  {
+  char d[DIGEST_LEN];
+  const char *m;
+  /* XXXX NM re-enable. 011 */
   /* Make sure routers aren't too far in the past any more. */
   r1.cache_info.published_on = time(NULL);
   r2.cache_info.published_on = time(NULL)-3*60*60;
@@ -1319,15 +1322,13 @@ test_dir_format(void)
   get_options()->Nickname = tor_strdup("DirServer");
   test_assert(!dirserv_dump_directory_to_string(&cp,pk3));
   crypto_pk_get_digest(pk3, d);
-#if 0
-  /* XXXX NM re-enable. 011 */
   test_assert(!router_parse_directory(cp));
   test_eq(2, smartlist_len(dir1->routers));
+  tor_free(cp);
+  }
 #endif
   dirserv_free_fingerprint_list();
 
-  tor_free(cp);
-
   tor_free(pk1_str);
   tor_free(pk2_str);
   if (pk1) crypto_free_pk_env(pk1);



More information about the tor-commits mailing list