]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Simulation test cases.
authorscipio <scipio>
Wed, 4 Jul 2007 15:53:56 +0000 (15:53 +0000)
committerscipio <scipio>
Wed, 4 Jul 2007 15:53:56 +0000 (15:53 +0000)
apps/tests/TestSimComm/TestCommC.nc
apps/tests/TestSimTimers/TestTimerC.nc
apps/tests/TestSimTimers/script.py

index 55457a32c9791b10aa36891cc6d186410e2e45af..0ad5de3f0e6c3357dcc5841e07470eb5917155f6 100644 (file)
@@ -55,6 +55,7 @@ implementation {
   uint8_t busy;
   
   event void Boot.booted() {
+    dbg("TestComm", "Booted @ %s.\n", sim_time_string());
     call SplitControl.start();
   }
 
index ee18f71a1254730f2dedc0457e9901292cbbbfce..944b6984ae4a5f576d96173921d50db3b194dc65 100644 (file)
@@ -64,10 +64,10 @@ implementation {
     sim_time_t elapsed = now - start;
     elapsed /= (sim_ticks_per_sec() / 1024);
     if (elapsed != interval) {
-      dbg("TestTimer", "Timer %c is off. Should have fired in %u, fired in %u.\n", name, interval, (uint32_t)elapsed);
+      dbg("TestTimer", "Timer %c is off. Should have fired in %u, fired in %u @ %s.\n", name, interval, (uint32_t)elapsed, sim_time_string());
     }
     else {
-      dbg("TestTimer", "Timer %c is good.\n", name);
+      dbg("TestTimer", "Timer %c is good @ %s.\n", name, sim_time_string());
     }
   }
   
@@ -81,8 +81,8 @@ implementation {
   void startTimers() {
     call A.startPeriodic(aTime);
     call B.startPeriodic(bTime);
-    call C.startOneShot(cTime);
-    call D.startOneShot(dTime);
+//    call C.startOneShot(cTime);
//   call D.startOneShot(dTime);
     aStart = bStart = cStart = dStart = sim_time();
   }
   
@@ -104,7 +104,7 @@ implementation {
   event void B.fired() {
     check('B', bStart, bTime);
     call B.stop();
-    bTime = 1 + (call Random.rand32() & 0x3ff);
+    bTime = 1 + (call Random.rand32() & 0x3fff);
     call B.startPeriodic(bTime);
     bStart = sim_time();
   }
index 6feb89ec3130398c5efc571932bf9b53ec5336e8..d421251606932472bd2404940a9d64d70e975c01 100644 (file)
@@ -14,7 +14,7 @@ m1 = t.getNode(0)
 
 m1.bootAtTime(345321);
 
-for i in range(0, 1000000):
+for i in range(0, 10000):
     t.runNextEvent();