updated cooja/mspsim test for coffee. now with GC

This commit is contained in:
nvt-se 2008-12-12 13:24:42 +00:00
parent 1f03e79a89
commit 747d27ecda
2 changed files with 32 additions and 12 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: test-coffee.c,v 1.5 2008/12/12 10:28:11 nvt-se Exp $
* $Id: test-coffee.c,v 1.6 2008/12/12 13:24:42 nvt-se Exp $
*/
/**
@ -306,7 +306,7 @@ PROCESS_THREAD(testcoffee_process, ev, data)
{
PROCESS_BEGIN();
printf("Coffee consistency test: %d\n", coffee_file_test());
printf("Coffee file test: %d\n", coffee_file_test());
printf("Coffee garbage collection test: %d\n", coffee_gc_test());
PROCESS_END();

View file

@ -1,10 +1,30 @@
/* Script is called once for every node log output. */
/* Input variables: Mote mote, int id, String msg. */
if (msg.startsWith('Coffee consistency test: 0')) {
log.log('TEST OK');
mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/
} else if (msg.startsWith('Coffee consistency test')) {
log.log('TEST FAILED');
mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/
}
if (msg.startsWith('Coffee file test: 0')) {
global.put("coffee_file_test", true);
} else if (msg.startsWith('Coffee file test')) {
global.put("coffee_file_test", false);
} else if (msg.startsWith('Coffee garbage collection test: 0')) {
global.put("coffee_gc_test", true);
} else if (msg.startsWith('Coffee garbage collection test')) {
global.put("coffee_gc_test", false);
}
if (global.get("coffee_file_test") == null) {
//log.log("file test not finished yet\n");
return;
}
if (global.get("coffee_gc_test") == null) {
//log.log("gc test not finished yet\n");
return;
}
if (global.get("coffee_gc_test") == false) {
log.log("coffee garbage collection failed\n");
log.testFailed();
}
if (global.get("coffee_file_test") == false) {
log.log("coffee file test failed\n");
log.testFailed();
}
log.testOK();