From 03ae4c91fac1805d84fc35e19fec1087b3c64040 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 23 Apr 2016 01:10:00 +0200 Subject: [PATCH] Fix output of RPL tests --- regression-tests/12-rpl/01-rpl-up-route.csc | 10 ++++------ regression-tests/12-rpl/02-rpl-root-reboot.csc | 10 ++++------ regression-tests/12-rpl/03-rpl-28-hours.csc | 10 ++++------ regression-tests/12-rpl/04-rpl-large-network.csc | 10 ++++------ regression-tests/12-rpl/05-rpl-up-and-down-routes.csc | 10 ++++------ regression-tests/12-rpl/06-rpl-temporary-root-loss.csc | 10 ++++------ regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc | 10 ++++------ regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc | 10 ++++------ regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc | 10 ++++------ regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc | 10 ++++------ regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc | 10 ++++------ regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc | 10 ++++------ regression-tests/12-rpl/09-rpl-probing.csc | 10 ++++------ regression-tests/12-rpl/10-rpl-multi-dodag.csc | 10 ++++------ 14 files changed, 56 insertions(+), 84 deletions(-) diff --git a/regression-tests/12-rpl/01-rpl-up-route.csc b/regression-tests/12-rpl/01-rpl-up-route.csc index 5af9d8857..fc79cfc27 100644 --- a/regression-tests/12-rpl/01-rpl-up-route.csc +++ b/regression-tests/12-rpl/01-rpl-up-route.csc @@ -315,22 +315,20 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/02-rpl-root-reboot.csc b/regression-tests/12-rpl/02-rpl-root-reboot.csc index ce9f3cee0..14f87c7a9 100644 --- a/regression-tests/12-rpl/02-rpl-root-reboot.csc +++ b/regression-tests/12-rpl/02-rpl-root-reboot.csc @@ -315,22 +315,20 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/03-rpl-28-hours.csc b/regression-tests/12-rpl/03-rpl-28-hours.csc index a8cefd469..1cf2c5e43 100644 --- a/regression-tests/12-rpl/03-rpl-28-hours.csc +++ b/regression-tests/12-rpl/03-rpl-28-hours.csc @@ -264,22 +264,20 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/04-rpl-large-network.csc b/regression-tests/12-rpl/04-rpl-large-network.csc index 145cad14c..e40b7a339 100644 --- a/regression-tests/12-rpl/04-rpl-large-network.csc +++ b/regression-tests/12-rpl/04-rpl-large-network.csc @@ -7030,22 +7030,20 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc b/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc index 3ed5a71f7..c2b3cb506 100644 --- a/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc +++ b/regression-tests/12-rpl/05-rpl-up-and-down-routes.csc @@ -313,22 +313,20 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc b/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc index bd771d7e7..08126f22b 100644 --- a/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc +++ b/regression-tests/12-rpl/06-rpl-temporary-root-loss.csc @@ -318,23 +318,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { lastMissed = num; numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc index afdbed672..b5aeac9b2 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-0.csc @@ -330,23 +330,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); seenMsgs++; -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc index 3657d4b8a..d17bc193c 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-1.csc @@ -330,23 +330,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); seenMsgs++; -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc index 8c78725a3..fe3db3dc3 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-2.csc @@ -330,23 +330,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); seenMsgs++; -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc index fd1983379..7ee838b2c 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-3.csc @@ -330,23 +330,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); seenMsgs++; -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc index 8db19c568..35c5bd753 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-4.csc @@ -330,23 +330,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); seenMsgs++; -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc b/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc index 0f4d7db7d..4dc5038bc 100644 --- a/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc +++ b/regression-tests/12-rpl/08-rpl-dao-route-loss-5.csc @@ -330,23 +330,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); seenMsgs++; -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/09-rpl-probing.csc b/regression-tests/12-rpl/09-rpl-probing.csc index bc29029af..5206f1cfd 100644 --- a/regression-tests/12-rpl/09-rpl-probing.csc +++ b/regression-tests/12-rpl/09-rpl-probing.csc @@ -226,23 +226,21 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } lastMsgHops = hops; + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } } diff --git a/regression-tests/12-rpl/10-rpl-multi-dodag.csc b/regression-tests/12-rpl/10-rpl-multi-dodag.csc index aa0ab3d43..fa015e8d9 100644 --- a/regression-tests/12-rpl/10-rpl-multi-dodag.csc +++ b/regression-tests/12-rpl/10-rpl-multi-dodag.csc @@ -356,12 +356,8 @@ while(true) { } else if(msg.startsWith("#L") && msg.endsWith("1; red")) { hops++; } else if(msg.startsWith("Data")) { -// log.log("" + msg + "\n"); data = msg.split(" "); num = parseInt(data[14]); - packets = packets.substr(0, num) + "*"; - log.log("" + hops + " " + packets + "\n"); -// log.log("Num " + num + "\n"); if(newSink) { newDagOk++; newSink = 0; @@ -369,13 +365,15 @@ while(true) { if(lastMsg != -1) { if(num != lastMsg + 1) { numMissed = num - lastMsg - 1; - lostMsgs += numMissed; + lostMsgs += numMissed; log.log("Missed messages " + numMissed + " before " + num + "\n"); for(i = 0; i < numMissed; i++) { - packets = packets.substr(0, lastMsg + i) + "_"; + packets = packets.substr(0, lastMsg + i + 1) + "_"; } } } + packets = packets.substr(0, num) + "*"; + log.log("" + hops + " " + packets + "\n"); lastMsg = num; } }