[tor-commits] [tor/master] Bug 26214: Test updates.

nickm at torproject.org nickm at torproject.org
Thu Jun 21 13:36:45 UTC 2018


commit 46b06cd6999439608f4a8a34bb68f6fe6a6311e9
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Tue Jun 19 19:53:58 2018 +0000

    Bug 26214: Test updates.
---
 src/test/test_relaycell.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 841174982..1bd17b73b 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -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 */





More information about the tor-commits mailing list