]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Assert rs are added in con and con_md tests
authorMatthew Finkel <Matthew.Finkel@gmail.com>
Wed, 27 May 2015 16:37:10 +0000 (16:37 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 18 Dec 2015 18:14:10 +0000 (13:14 -0500)
src/test/test_dir.c

index c18b5e81a8ca00dc6f2c4e18c9b4433fe22e8e48..97a9200bdbf5e194067740ba563c31158bcc9094 100644 (file)
@@ -1920,12 +1920,20 @@ test_a_networkstatus(
 
   /* Check the routerstatuses. */
   n_rs = smartlist_len(con->routerstatus_list);
+  tt_assert(n_rs);
   for (idx = 0; idx < n_rs; ++idx) {
     rs = smartlist_get(con->routerstatus_list, idx);
     tt_assert(rs);
     rs_test(rs, now);
   }
 
+  n_rs = smartlist_len(con_md->routerstatus_list);
+  tt_assert(n_rs);
+  for (idx = 0; idx < n_rs; ++idx) {
+    rs = smartlist_get(con_md->routerstatus_list, idx);
+    tt_assert(rs);
+  }
+
   /* Check signatures.  the first voter is a pseudo-entry with a legacy key.
    * The second one hasn't signed.  The fourth one has signed: validate it. */
   voter = smartlist_get(con->voters, 1);