updated threaded contiki test scripts

This commit is contained in:
fros4943 2009-01-08 16:55:53 +00:00
parent b2a1dd2156
commit 17fa4513dc

View file

@ -1,38 +1,38 @@
TIMEOUT(60000, log.log("nrLowAlpha: " + nrLowAlpha + "\nnrHighAlpha: " + nrHighAlpha + "\nnrLowCount: " + nrLowCount + "\nnrHighCount: " + nrHighCount + "\n"));
lowAlpha = "BA"; lowAlpha = "BA";
highAlpha = "JIHGFEDCBA"; highAlpha = "JIHGFEDCBA";
lowCount = "10"; lowCount = "10";
highCount = "9876543210"; highCount = "9876543210";
/* Filter messages */ nrLowAlpha = 0;
if (msg.equals(lowCount)) { nrHighAlpha = 0;
log.log("Count is low\n"); nrLowCount = 0;
} else if (msg.equals(lowAlpha)) { nrHighCount = 0;
log.log("Alpha is low\n");
} else if (msg.equals(highCount)) { while (true) {
log.log("Count is high\n");
} else if (msg.equals(highAlpha)) { if (msg.equals(lowCount)) {
log.log("Alpha is high\n"); //log.log("Count is low\n");
} else { nrLowCount++;
/* Ignore all other messages */ } else if (msg.equals(lowAlpha)) {
return; //log.log("Alpha is low\n");
nrLowAlpha++;
} else if (msg.equals(highCount)) {
//log.log("Count is high\n");
nrHighCount++;
} else if (msg.equals(highAlpha)) {
//log.log("Alpha is high\n");
nrHighAlpha++;
}
if (nrLowCount >= 5 &&
nrLowAlpha >= 5 &&
nrLowCount >= 5 &&
nrHighCount >= 5 &&
nrHighAlpha >= 5) {
log.testOK();
}
YIELD();
} }
/* Remember messages */
count = global.get(msg);
if (count == null) {
count = 0;
}
count++;
global.put(msg, count);
/* Wait during test */
count = global.get(lowAlpha);
if (count == null || count < 5) return;
count = global.get(highAlpha);
if (count == null || count < 5) return;
count = global.get(lowCount);
if (count == null || count < 5) return;
count = global.get(highCount);
if (count == null || count < 5) return;
log.testOK(); /* We are done! */