X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fnor_stress.c;h=b3704583a184ffc7f4f5b03f0285ee48783acd82;hp=0eaaf1bd0f23419dcd9cedd77b92396e7c1a0c06;hb=85530132e169794d9e7e9c1de1396a12bc650383;hpb=49942b13d7cfbdba72c18de0f37d16d81b4372a8 diff --git a/direct/nor_stress.c b/direct/nor_stress.c index 0eaaf1b..b370458 100644 --- a/direct/nor_stress.c +++ b/direct/nor_stress.c @@ -48,8 +48,8 @@ static void FatalError(void) static void UpdateCounter(const char *name, unsigned *val, int initialise) { - int inh; - int outh; + int inh=-1; + int outh=-1; unsigned x[2]; int nread = 0; int nwritten = 0; @@ -139,6 +139,9 @@ static void dump_directory_tree_worker(const char *dname,int recursive) if((s.st_mode & S_IFMT) == S_IFDIR && recursive) dump_directory_tree_worker(str,1); + + if(s.st_ino > 10000) + FatalError(); } @@ -287,10 +290,11 @@ static int yVerifyFile(const char *fName) 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) @@ -341,13 +345,16 @@ void NorStressTestRun(const char *prefix) 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); } }