#
# NB Warning this Makefile does not include header dependencies.
#
-# $Id: Makefile,v 1.20 2008-11-11 01:48:47 charles Exp $
+# $Id: Makefile,v 1.21 2008-11-21 02:19:30 charles Exp $
#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -DNO_Y_INLINE
CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing
#CFLAGS += -fno-strict-aliasing
-CFLAGS += -O3
+CFLAGS += -O0
#CFLAGS += -DVALGRIND_TEST
#CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
}
+int random_seed;
int main(int argc, char *argv[])
{
-
+ random_seed = time(NULL);
//return long_test(argc,argv);
//return cache_read_test();
return retval;
}
-static unsigned long next = 1;
+extern int random_seed;
+
int myrand(void) {
- next = next * 1103515245 + 12345;
- return((unsigned)(next/65536) % 32768);
+ random_seed = random_seed * 1103515245 + 12345;
+ return((unsigned)(random_seed/65536) % 32768);
}
static void DoUpdateMainFile(void)
dump_directory_tree(fullPathName);
UpdateCounter(fullPowerUpName,&powerUps,0);
+ dump_directory_tree(fullPathName);
while(1){
UpdateCounter(fullStartName, &cycleStarts,0);
+ dump_directory_tree(fullPathName);
DoVerifyMainFile();
DoUpdateMainFile();
dump_directory_tree(fullPathName);
UpdateCounter(fullEndName,&cycleEnds,0);
+ dump_directory_tree(fullPathName);
}
}
for ((i=0; i < 100000; i++))
do
- echo $i > cycle.count
+
+ seed=$RANDOM
j=$(( $i % 10 ))
-
+ rm seed*$j
+ echo $seed>seed$i
rm data*$j
cp ynorsimdata data$i
- ./yaffs_test /M18-1 fw_update
+ echo "######### Run $i with seed $seed"
+ ./yaffs_test /M18-1 fw_update $seed
done
+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
static __u32 word[YNORSIM_DEV_SIZE_U32];
+extern int random_seed;
static void NorError(void)
{
{
if(initialised)
return;
- srand(time(NULL));
+ srand(random_seed);
remaining_ops = 1000000000;
remaining_ops = (rand() % 10000) * 3000 * YNORSIM_BIT_CHANGES;
ynorsim_RestoreImage();