[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/storage/Log README.txt, 1.1.2.2, 1.1.2.3 RandRWC.nc, 1.1.2.6, 1.1.2.7

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/Log
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22588/Log

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/Log/Attic/README.txt,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** README.txt	31 May 2006 23:33:47 -0000	1.1.2.2
--- README.txt	16 Jun 2006 22:53:10 -0000	1.1.2.3
***************
*** 4,24 ****
  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: perform a full test
! k * 4 + 1: erase the log
! k * 4 + 2: read the log
! k * 4 + 3: write some 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. Or you can just run the
! test with mote id = 4 to do a complete test.
  
  A successful test will turn on the green led. A failed test will turn on
--- 4,28 ----
  Description:
  
! Application to test the LogStorageC abstraction, using the log in linear
! mode. There must be a volumes-<chip>.xml file in this directory describing
! 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 read test expects to see one or more consecutive results of the data
! written by the write test (with the same seed). The last write data can be
! partial.  So, for instance, you could run the test with mote id = 104, then
! 304 twice to erase the log and write 2 copies of the data sequence for k =
! 4, then run with mote id = 204 to test all these writes. Or you can just
! run the test with mote id = 4 to do a complete test.
! 
! If the log fills up (which should take 4 or 5 write operations), the write 
! will fail, but a subsequent read will succeed.
  
  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/Log/Attic/RandRWC.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** RandRWC.nc	6 Jun 2006 20:45:31 -0000	1.1.2.6
--- RandRWC.nc	16 Jun 2006 22:53:10 -0000	1.1.2.7
***************
*** 33,37 ****
    enum {
      SIZE = 1024L * 256,
!     NWRITES = SIZE / 4096,
    };
  
--- 33,37 ----
    enum {
      SIZE = 1024L * 256,
!     NWRITES = SIZE / 512,
    };
  
***************
*** 60,66 ****
  
    void resetSeed() {
!     shiftReg = 119 * 119 * ((TOS_NODE_ID >> 2) + 1);
      initSeed = shiftReg;
!     mask = 137 * 29 * ((TOS_NODE_ID >> 2) + 1);
    }
    
--- 60,66 ----
  
    void resetSeed() {
!     shiftReg = 119 * 119 * ((TOS_NODE_ID % 100) + 1);
      initSeed = shiftReg;
!     mask = 137 * 29 * ((TOS_NODE_ID % 100) + 1);
    }
    
***************
*** 219,235 ****
  
    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++;
    }
--- 219,246 ----
  
    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