More test fiddling
authorcharles <charles>
Fri, 9 Jan 2009 02:59:47 +0000 (02:59 +0000)
committercharles <charles>
Fri, 9 Jan 2009 02:59:47 +0000 (02:59 +0000)
direct/tests/yaffs_fsx.c
direct/tests/yaffs_fsx.h
direct/tests/yaffs_test.c
direct/yaffscfg2k.c
direct/ynorsim.c

index 25d9605354c469dede67b1f6d26ee7f51a1251d7..54f5360ce0446677de3728f123f776240ed23759 100644 (file)
@@ -46,6 +46,8 @@
  *
  */
 
+#include "yaffs_fsx.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifdef _UWIN
@@ -133,7 +135,6 @@ int writebdy = 1;                   /* -w flag */
 long   monitorstart = -1;              /* -m flag */
 long   monitorend = -1;                /* -m flag */
 int    lite = 0;                       /* -L flag */
-long   numops = /*-1 */ 10000000;                      /* -N flag */
 int    randomoplen = 1;                /* -O flag disables it */
 int    seed = 1;                       /* -S flag */
 
@@ -150,7 +151,7 @@ int closeopen = 0;
 void EXIT(int x)
 {
        printf("fsx wanted to exit with %d\n",x);
-       while(1){}
+       while(x){}
 }
 
 char goodfile[1024];
@@ -798,8 +799,7 @@ int mounted_by_fsx = 0;
 int
 yaffs_fsx_init(const char *mount_pt)
 {
-       int     i, style, ch;
-       char    *endp;
+       int     i;
 
        goodfile[0] = 0;
        logfile[0] = 0;
@@ -905,10 +905,12 @@ int yaffs_fsx_complete(void)
 }
 
 int
-yaffs_fsx_main(const char *mount_pt)
+yaffs_fsx_main(const char *mount_pt, int numops)
 {
        yaffs_fsx_init(mount_pt);
        while (numops == -1 || numops--)
                yaffs_fsx_do_op();
        yaffs_fsx_complete();
+       
+       return 0;
 }
index e4cf3caeb43198d44897d2eb6fd28e9b1495a6cc..640c7a9d9d9ffe026163b4b85846dddaf2a21222 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef __YAFFS_FSX_H__
 #define __YAFFS_FSX_H__
 
+int yaffs_fsx_main(const char *mountpt,int n_cycles);
 int yaffs_fsx_init(const char *mountpt);
 int yaffs_fsx_complete(void);
-int yaffs_fsx_do_op(void);
+void yaffs_fsx_do_op(void);
 
 #endif
 
index c2f1b55defcf47481ba9464c79fe4b729318a4c0..421b5b17708b1c4df38e3a4db0ffd7afbea3236a 100644 (file)
@@ -37,6 +37,8 @@ int init_test;
 int do_upgrade;
 int n_cycles = -1;
 
+extern int ops_multiplier;
+
 char mount_point[200];
 
 void BadUsage(void)
@@ -49,7 +51,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 +66,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;
@@ -99,7 +104,7 @@ int main(int argc, char **argv)
                        printf("Running stress on %s with seed %d\n",argv[1],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();
index fb8982d8da61250a4f589cd9c1f550d42a2d2fa0..6cc8e75cde4ca8bfc4a686679c95e287e9152a04 100644 (file)
@@ -124,7 +124,6 @@ static yaffsfs_DeviceConfiguration yaffsfs_config[] = {
        { "/M18-1", &m18_1Dev},
        { "/yaffs2", &flashDev},
        { "/ram2k", &ram2kDev},
-       { "/flash/bigblock", &flashDev},
        {(void *)0,(void *)0} /* Null entry to terminate list */
 };
 
index f18eac03c3c9f524ea4ce573b3c793f64b9a824d..dcab663cc89ecd9dffa80c89f5235792d293acc6 100644 (file)
@@ -74,6 +74,8 @@ static int initialised = 0;
 static int remaining_ops;
 static int nops_so_far;
 
+int ops_multiplier = 500;
+
 static void ynorsim_MaybePowerFail(void)
 {
 
@@ -94,7 +96,7 @@ static void ynorsim_Ready(void)
     return;
   srand(random_seed);
   remaining_ops = 1000000000;
-  remaining_ops = (rand() % 10000) * 4000 * YNORSIM_BIT_CHANGES;
+  remaining_ops = (rand() % 10000) * ops_multiplier * YNORSIM_BIT_CHANGES;
   ynorsim_RestoreImage();
 }