Tweaks to nor stress simulation. Save random seed so that we can do better debugging
[yaffs2.git] / direct / yaffs_test.c
index 381df44..04e3b2a 100644 (file)
 
 
 
+int random_seed;
+
 void BadUsage(void)
 {
-       printf("usage root_dir test_id\n");
+       printf("usage root_dir test_id seed \n");
        printf(" test_id: fw_update fw_update_init\n");
        exit(2);
 }
 int main(int argc, const char *argv[])
 {
        yaffs_StartUp();
-       if(argc == 3) {
+       if(argc == 4) {
+               random_seed = atoi(argv[3]);
+               if(random_seed <= 0)
+                       BadUsage();
+                       
                if(!strcmp(argv[2],"fw_update_init")){
                        NorStressTestInitialise(argv[1]);
                }
                else if(!strcmp(argv[2],"fw_update")){
+                       printf("Running stress on %s with seed %d\n",argv[1],random_seed);
                        NorStressTestRun(argv[1]);
                }
                else