[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.2.4] Test improvement: include microdesc lines in our synthetic microdesc consensuses.



commit c35ef8e6e92f1d3f4e96fc71c8db6a17b812053e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Apr 2 11:49:30 2013 -0400

    Test improvement: include microdesc lines in our synthetic microdesc consensuses.
---
 src/or/or.h         |    3 ++-
 src/test/test_dir.c |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/or/or.h b/src/or/or.h
index 45eb467..b821caf 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2321,7 +2321,8 @@ typedef struct networkstatus_v2_t {
 typedef struct vote_microdesc_hash_t {
   /** Next element in the list, or NULL. */
   struct vote_microdesc_hash_t *next;
-  /** The raw contents of the microdesc hash line, excluding the "m". */
+  /** The raw contents of the microdesc hash line, from the "m" through the
+   * newline. */
   char *microdesc_hash_line;
 } vote_microdesc_hash_t;
 
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index ea0011a..6652ee0 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -863,6 +863,13 @@ gen_routerstatus_for_v3ns(int idx, time_t now)
       /* Shouldn't happen */
       test_assert(0);
   }
+  if (vrs) {
+    vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
+    tor_asprintf(&vrs->microdesc->microdesc_hash_line,
+                 "m 9,10,11,12,13,14,15,16,17 "
+                 "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
+                 idx);
+  }
 
  done:
   return vrs;
@@ -1832,6 +1839,13 @@ gen_routerstatus_for_umbw(int idx, time_t now)
       /* Shouldn't happen */
       test_assert(0);
   }
+  if (vrs) {
+    vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
+    tor_asprintf(&vrs->microdesc->microdesc_hash_line,
+                 "m 9,10,11,12,13,14,15,16,17 "
+                 "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
+                 idx);
+  }
 
  done:
   return vrs;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits