[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/storage/CircularLog README.txt, 1.1.2.1, 1.1.2.2 RandRWC.nc, 1.1.2.4, 1.1.2.5

David Gay idgay at users.sourceforge.net
Fri Jun 16 15:53:12 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/storage/CircularLog
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22588/CircularLog

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	README.txt RandRWC.nc 
Log Message:
switch to TKK id's, where KK is the seed and T the action. T=0 is 
"run full test" for all 4 tests.


Index: README.txt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/storage/CircularLog/Attic/README.txt,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** README.txt	24 May 2006 17:40:28 -0000	1.1.2.1
--- README.txt	16 Jun 2006 22:53:10 -0000	1.1.2.2
***************
*** 1,23 ****
! README for Log
  Author/Contact: tinyos-help at millennium.berkeley.edu
  
  Description:
  
! Application to test the LogStorageC abstraction. There must be a
! volumes-<chip>.xml file in this directory describing the test volume
! for your flash chip.
  
! The mote id controls a random seed used in the test (k), and the actual
! test performed
! k * 4: erase the log
! k * 4 + 1: erase the log and write some data
! k * 4 + 2: read the log
! k * 4 + 3: write more data to the log
  
! The read test expects to see one or more consecutive results of the
! data written by the write test. The last write data can be partial.
! So, for instance, you could run the test with mote id = 5, then 7 twice
! to erase the log and write 3 copies of the data sequence for k = 1, then
! run with mote id = 6 to test all these writes.
  
  A successful test will turn on the green led. A failed test will turn on
--- 1,27 ----
! README for CircularLog
  Author/Contact: tinyos-help at millennium.berkeley.edu
  
  Description:
  
! Application to test the LogStorageC abstraction, using the log in circular
! mode. There must be a volumes-<chip>.xml file in this directory describing
! the a 256kB volume named LOGTEST for your flash chip.
  
! The mote id is of the form T*100 + k, where k is a random seed and
! T specifies the test to be performed:
  
! T = 0: perform a full test
! T = 1: erase the log
! T = 2: read the log
! T = 3: write some data to the log
! 
! The write test writes a random sequence of 4095 32-byte records chosen from
! a set of 16 possible records. The read test checks that the log contains
! that all records in the log are one of the 16 possible records. The valid
! records depend on the seed. Running 2 write tests will fill the log, and
! the third one will wrap around. So for instance, you could run the test
! with id = 117 (erase), then 317 three times (fill the log and wrap around),
! then 217 to check that the log is valid. Or just run it with id = 17
! to perform a full test.
  
  A successful test will turn on the green led. A failed test will turn on

Index: RandRWC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/storage/CircularLog/Attic/RandRWC.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** RandRWC.nc	1 Jun 2006 16:35:31 -0000	1.1.2.4
--- RandRWC.nc	16 Jun 2006 22:53:10 -0000	1.1.2.5
***************
*** 33,39 ****
    enum {
      SIZE = 1024L * 256,
-     NWRITES = SIZE / 512,
      RECSIZE = 32,
!     NRECS = 16
    };
  
--- 33,39 ----
    enum {
      SIZE = 1024L * 256,
      RECSIZE = 32,
!     NRECS = 16,
!     NWRITES = SIZE / (2 * RECSIZE),
    };
  
***************
*** 62,68 ****
  
    void resetSeed() {
!     shiftReg = 119 * 119 * ((TOS_NODE_ID >> 2) + 1);
      initSeed = shiftReg;
!     mask = 137 * 29 * ((TOS_NODE_ID >> 2) + 1);
    }
    
--- 62,68 ----
  
    void resetSeed() {
!     shiftReg = 119 * 119 * ((TOS_NODE_ID % 100) + 1);
      initSeed = shiftReg;
!     mask = 137 * 29 * ((TOS_NODE_ID % 100) + 1);
    }
    
***************
*** 213,229 ****
  
    void done() {
      call Leds.led2Toggle();
  
!     if (TOS_NODE_ID & 3)
        {
  	if (testCount)
  	  success();
  	else
! 	  doAction(TOS_NODE_ID & 3);
        }
-     else if (testCount < sizeof actions)
-       doAction(actions[testCount]);
-     else
-       success();
      testCount++;
    }
--- 213,240 ----
  
    void done() {
+     uint8_t act = TOS_NODE_ID / 100;
+ 
      call Leds.led2Toggle();
  
!     switch (act)
        {
+       case 0:
+ 	if (testCount < sizeof actions)
+ 	  doAction(actions[testCount]);
+ 	else
+ 	  success();
+ 	break;
+ 
+       case A_ERASE: case A_READ: case A_WRITE:
  	if (testCount)
  	  success();
  	else
! 	  doAction(act);
! 	break;
! 
!       default:
! 	fail(FAIL);
! 	break;
        }
      testCount++;
    }



More information about the Tinyos-2-commits mailing list