nes-proj/tools/cooja/contiki_tests/multithreading.js

39 lines
852 B
JavaScript
Raw Normal View History

2009-01-08 16:55:53 +00:00
TIMEOUT(60000, log.log("nrLowAlpha: " + nrLowAlpha + "\nnrHighAlpha: " + nrHighAlpha + "\nnrLowCount: " + nrLowCount + "\nnrHighCount: " + nrHighCount + "\n"));
lowAlpha = "BA";
highAlpha = "JIHGFEDCBA";
lowCount = "10";
highCount = "9876543210";
2009-01-08 16:55:53 +00:00
nrLowAlpha = 0;
nrHighAlpha = 0;
nrLowCount = 0;
nrHighCount = 0;
2009-01-08 16:55:53 +00:00
while (true) {
2009-01-08 16:55:53 +00:00
if (msg.equals(lowCount)) {
//log.log("Count is low\n");
nrLowCount++;
} else if (msg.equals(lowAlpha)) {
//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();
}