瀏覽代碼

Fix a dumb C bug in the unit tests for 9841

Fixes bug 11460; bug only affects unit tests and is not in any
released version of Tor.
Nick Mathewson 10 年之前
父節點
當前提交
2f73525883
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/test/test_circuitlist.c

+ 4 - 1
src/test/test_circuitlist.c

@@ -177,7 +177,10 @@ test_rend_token_maps(void *arg)
   c3 = or_circuit_new(0, NULL);
   c3 = or_circuit_new(0, NULL);
   c4 = or_circuit_new(0, NULL);
   c4 = or_circuit_new(0, NULL);
 
 
-  tt_int_op(strlen((char*)tok1), ==, REND_TOKEN_LEN);
+  /* Make sure we really filled up the tok* variables */
+  tt_int_op(tok1[REND_TOKEN_LEN-1], ==, 'y');
+  tt_int_op(tok2[REND_TOKEN_LEN-1], ==, ' ');
+  tt_int_op(tok3[REND_TOKEN_LEN-1], ==, '.');
 
 
   /* No maps; nothing there. */
   /* No maps; nothing there. */
   tt_ptr_op(NULL, ==, circuit_get_rendezvous(tok1));
   tt_ptr_op(NULL, ==, circuit_get_rendezvous(tok1));