]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bug 26214: Test updates.
authorMike Perry <mikeperry-git@torproject.org>
Tue, 19 Jun 2018 19:53:58 +0000 (19:53 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 Jun 2018 13:18:51 +0000 (09:18 -0400)
src/test/test_relaycell.c

index 841174982c8f788ef88c379848911e488bf125e9..1bd17b73bfef0a3df154087774d9a36dff13c318 100644 (file)
@@ -240,11 +240,26 @@ test_circbw_relay(void *arg)
                                      circ->cpath);
   ASSERT_UNCOUNTED_BW();
 
-  /* Sendme on stream: not counted */
+  /* Sendme on valid stream: counted */
   ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0;
   PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234");
   connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), edgeconn,
                                      circ->cpath);
+  ASSERT_COUNTED_BW();
+
+  /* Sendme on valid stream with full window: not counted */
+  ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0;
+  PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234");
+  edgeconn->package_window = 500;
+  connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), edgeconn,
+                                     circ->cpath);
+  ASSERT_UNCOUNTED_BW();
+
+  /* Sendme on unknown stream: not counted */
+  ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0;
+  PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234");
+  connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), NULL,
+                                     circ->cpath);
   ASSERT_UNCOUNTED_BW();
 
   /* Sendme on circuit with full window: not counted */