mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
updated threaded contiki test scripts
This commit is contained in:
parent
b2a1dd2156
commit
17fa4513dc
@ -1,38 +1,38 @@
|
||||
TIMEOUT(60000, log.log("nrLowAlpha: " + nrLowAlpha + "\nnrHighAlpha: " + nrHighAlpha + "\nnrLowCount: " + nrLowCount + "\nnrHighCount: " + nrHighCount + "\n"));
|
||||
|
||||
lowAlpha = "BA";
|
||||
highAlpha = "JIHGFEDCBA";
|
||||
lowCount = "10";
|
||||
highCount = "9876543210";
|
||||
|
||||
/* Filter messages */
|
||||
if (msg.equals(lowCount)) {
|
||||
log.log("Count is low\n");
|
||||
} else if (msg.equals(lowAlpha)) {
|
||||
log.log("Alpha is low\n");
|
||||
} else if (msg.equals(highCount)) {
|
||||
log.log("Count is high\n");
|
||||
} else if (msg.equals(highAlpha)) {
|
||||
log.log("Alpha is high\n");
|
||||
} else {
|
||||
/* Ignore all other messages */
|
||||
return;
|
||||
nrLowAlpha = 0;
|
||||
nrHighAlpha = 0;
|
||||
nrLowCount = 0;
|
||||
nrHighCount = 0;
|
||||
|
||||
while (true) {
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/* 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! */
|
||||
|
Loading…
Reference in New Issue
Block a user