summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-08-09 04:26:25 +0000
committerNick Mathewson <nickm@torproject.org>2004-08-09 04:26:25 +0000
commite6c34ad071a959328a3cf35f819c1c1fff303c03 (patch)
treee5cd430133061a5f041e4b9f49d90ff15bd640e8
parent6ebdc21e515a1b21f5ebe2c41e2fb436ea9ee2ea (diff)
downloadtor-e6c34ad071a959328a3cf35f819c1c1fff303c03.tar.gz
tor-e6c34ad071a959328a3cf35f819c1c1fff303c03.zip
Make unittests pass
svn:r2205
-rw-r--r--src/or/test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 0a993fbf91..704d3901ba 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -673,6 +673,7 @@ test_dir_format()
struct exit_policy_t ex1, ex2;
routerlist_t *dir1 = NULL, *dir2 = NULL;
tor_version_t ver1;
+ char *bw_lines = NULL;
test_assert( (pk1 = crypto_new_pk_env()) );
test_assert( (pk2 = crypto_new_pk_env()) );
@@ -723,6 +724,11 @@ test_dir_format()
r2.exit_policy = &ex1;
r2.nickname = "Fred";
+ bw_lines = rep_hist_get_bandwidth_lines();
+ test_assert(bw_lines);
+ test_assert(!strncmp(bw_lines, "opt write-history ",
+ strlen("opt write-history ")));
+
test_assert(!crypto_pk_write_public_key_to_string(pk1, &pk1_str,
&pk1_str_len));
test_assert(!crypto_pk_write_public_key_to_string(pk2 , &pk2_str,
@@ -750,10 +756,12 @@ test_dir_format()
strcat(buf2, pk1_str);
strcat(buf2, "signing-key\n");
strcat(buf2, pk2_str);
+ strcat(buf2, bw_lines);
strcat(buf2, "router-signature\n");
buf[strlen(buf2)] = '\0'; /* Don't compare the sig; it's never the same twice*/
test_streq(buf, buf2);
+ tor_free(bw_lines);
test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
cp = buf;