Add fix for hanging objects
[yaffs2.git] / direct / tests / yaffs_test.c
index c2f1b55defcf47481ba9464c79fe4b729318a4c0..3b0e62a9ba50dde7e82cc09c12005392fa3d761e 100644 (file)
@@ -37,10 +37,21 @@ int init_test;
 int do_upgrade;
 int n_cycles = -1;
 
+extern int ops_multiplier;
+
 char mount_point[200];
 
 void BadUsage(void)
 {
+       printf("Usage: yaffs_test [options] mountpoint\n");
+       printf("options\n");
+       printf(" f: do fsx testing\n");
+       printf(" i: initialise for upgrade testing\n");
+       printf(" l: multiply number of operations by 5\n");
+       printf(" n nnn: number of cycles\n");
+       printf(" p: simulate power fail testing\n");
+       printf(" s sss: set seed\n");
+       printf(" u: do upgrade test\n");
        exit(2);
 }
 
@@ -49,7 +60,7 @@ int main(int argc, char **argv)
        int ch;
        
 
-       while ((ch = getopt(argc,argv, "fin:ps:u"))
+       while ((ch = getopt(argc,argv, "filn:ps:u"))
               != EOF)
                switch (ch) {
                case 's':
@@ -64,6 +75,9 @@ int main(int argc, char **argv)
                case 'f':
                        do_fsx = 1;
                        break;
+               case 'l':
+                       ops_multiplier *= 5;
+                       break;
                case 'u':
                        do_upgrade = 1;
                        break;
@@ -91,15 +105,16 @@ int main(int argc, char **argv)
 
                yaffs_StartUp();
                yaffs_mount(mount_point);
+               printf("Mount complete\n");
                        
                if(do_upgrade && init_test){
                        simulate_power_failure = 0;
                        NorStressTestInitialise(mount_point);
                } else if(do_upgrade){
-                       printf("Running stress on %s with seed %d\n",argv[1],random_seed);
+                       printf("Running stress on %s with seed %d\n",mount_point,random_seed);
                        NorStressTestRun(mount_point,n_cycles,do_fsx);
                } else if(do_fsx){
-                       yaffs_fsx_main(mount_point);
+                       yaffs_fsx_main(mount_point,n_cycles);
                }else {
                        printf("No test to run!\n");
                        BadUsage();