changeset 251:8f7c77cf2c67

More test fiddling
author charles
date Fri, 09 Jan 2009 02:59:47 +0000
parents 131343232124
children 67ca7e10e918
files direct/tests/yaffs_fsx.c direct/tests/yaffs_fsx.h direct/tests/yaffs_test.c direct/yaffscfg2k.c direct/ynorsim.c
diffstat 5 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/direct/tests/yaffs_fsx.c
+++ b/direct/tests/yaffs_fsx.c
@@ -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;
 }
--- a/direct/tests/yaffs_fsx.h
+++ b/direct/tests/yaffs_fsx.h
@@ -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
 
--- a/direct/tests/yaffs_test.c
+++ b/direct/tests/yaffs_test.c
@@ -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();
--- a/direct/yaffscfg2k.c
+++ b/direct/yaffscfg2k.c
@@ -124,7 +124,6 @@ static yaffsfs_DeviceConfiguration yaffs
 	{ "/M18-1", &m18_1Dev},
 	{ "/yaffs2", &flashDev},
 	{ "/ram2k", &ram2kDev},
-	{ "/flash/bigblock", &flashDev},
 	{(void *)0,(void *)0} /* Null entry to terminate list */
 };
 
--- a/direct/ynorsim.c
+++ b/direct/ynorsim.c
@@ -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();
 }