Some test case changes
authorcharles <charles>
Wed, 26 Nov 2008 20:49:36 +0000 (20:49 +0000)
committercharles <charles>
Wed, 26 Nov 2008 20:49:36 +0000 (20:49 +0000)
direct/dtest.c
direct/fsx_test/yaffs_fsx.c
direct/yaffs_test.c
direct/ynorsim.c

index 4478cdc..5b4d6a6 100644 (file)
@@ -2281,9 +2281,25 @@ void random_small_file_test(const char *mountpt,int iterations)
                
        yaffs_unmount(mountpt);
 }
+
+void rmdir_test(const char *mountpt)
+{
+       char name[100];
+       yaffs_StartUp();
+       
+       yaffs_mount(mountpt);
+       
+       strcpy(name,mountpt);
+       strcat(name,"/");
+       strcat(name,"hello");
+       yaffs_mkdir(name,0666);
+       yaffs_rmdir(name);
+       yaffs_unmount(mountpt);
+}
        
 
 int random_seed;
+int simulate_power_failure;
 
 int main(int argc, char *argv[])
 {
@@ -2300,7 +2316,9 @@ int main(int argc, char *argv[])
         //yaffs_backward_scan_test("/flash/flash");
        // yaffs_device_flush_test("/flash/flash");
 
-       rename_over_test("//////////////////flash///////////////////yaffs1///////////");
+       //rename_over_test("//////////////////flash///////////////////yaffs1///////////");
+       
+       rmdir_test("M18-1");
        
         //scan_pattern_test("/flash",10000,10);
        //short_scan_test("/flash/flash",40000,200);
index 31b0751..484241b 100644 (file)
@@ -774,7 +774,10 @@ getnum(char *s, char **e)
 }
 
 
-#define BASE_NAME "/flash/yaffs1"
+#define BASE_NAME "/M18-1"
+
+int random_seed = 999;
+int simulate_power_failure = 0;
 
 int
 main(int argc, char **argv)
index 04e3b2a..2a17f75 100644 (file)
@@ -27,6 +27,7 @@
 
 
 int random_seed;
+int simulate_power_failure = 0;
 
 void BadUsage(void)
 {
@@ -47,6 +48,7 @@ int main(int argc, const char *argv[])
                }
                else if(!strcmp(argv[2],"fw_update")){
                        printf("Running stress on %s with seed %d\n",argv[1],random_seed);
+                       simulate_power_failure = 1;
                        NorStressTestRun(argv[1]);
                }
                else 
index 6936a9c..723b72b 100644 (file)
@@ -40,6 +40,7 @@
 static __u32 word[YNORSIM_DEV_SIZE_U32];
 
 extern int random_seed;
+extern int simulate_power_failure;
 
 static void NorError(void)
 {
@@ -80,7 +81,8 @@ static void ynorsim_MaybePowerFail(void)
    
    
    remaining_ops--;
-   if(remaining_ops < 1){
+   if(simulate_power_failure &&
+      remaining_ops < 1){
        printf("Simulated power failure after %d operations\n",nops_so_far);
        ynorsim_PowerFail();
   }
@@ -92,7 +94,7 @@ static void ynorsim_Ready(void)
     return;
   srand(random_seed);
   remaining_ops = 1000000000;
-  remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES;
+  remaining_ops = (rand() % 10000) * 300 * YNORSIM_BIT_CHANGES;
   ynorsim_RestoreImage();
 }