From 6e7beb93cb7541c0c221090c4372a8be8fdef3aa Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 11 Aug 2013 15:12:18 +0200 Subject: [PATCH] Made it easier to configure how many packets that should be received. Reduced the total amount of packets from 10 to 8 to make the test complete faster. --- .../09-collect-lossy/01-sky-shell-collect-lossy.csc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/regression-tests/09-collect-lossy/01-sky-shell-collect-lossy.csc b/regression-tests/09-collect-lossy/01-sky-shell-collect-lossy.csc index a8c1d9ff6..dbc85c0b4 100644 --- a/regression-tests/09-collect-lossy/01-sky-shell-collect-lossy.csc +++ b/regression-tests/09-collect-lossy/01-sky-shell-collect-lossy.csc @@ -398,6 +398,7 @@ booted = new Array(); received = new Array(); hops = new Array(); nrNodes = 20; +toReceive = 8; total_received = 0; total_lost = 0; total_hops = 0; @@ -411,7 +412,10 @@ total_latency = 0; nodes_starting = true; for(i = 1; i <= nrNodes; i++) { booted[i] = false; - received[i] = "__________"; + received[i] = ''; + for(var j = 0; j < toReceive; j++) { + received[i] += '_'; + } hops[i] = received[i]; } @@ -495,20 +499,20 @@ while(true) { dups++; } received[source] = received[source].substr(0, seqno) + dups + - received[source].substr(seqno + 1, 10 - seqno); + received[source].substr(seqno + 1, toReceive - seqno); if(hop > 9) { hop = "+"; } hops[source] = hops[source].substr(0, seqno) + hop + - hops[source].substr(seqno + 1, 10 - seqno); + hops[source].substr(seqno + 1, toReceive - seqno); total_received++; total_hops += hop; print_stats(); } - /* Signal OK if all nodes have reported 10 messages. */ + /* Signal OK if all nodes have reported toReceive messages. */ num_reported = 0; for(i = 1; i <= nrNodes; i++) { if(i != sink) {