projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some test case changes
[yaffs2.git]
/
direct
/
nor_stress.c
diff --git
a/direct/nor_stress.c
b/direct/nor_stress.c
index 0eaaf1bd0f23419dcd9cedd77b92396e7c1a0c06..b3704583a184ffc7f4f5b03f0285ee48783acd82 100644
(file)
--- 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)
{
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;
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_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;
}
return retval;
}
-static unsigned long next = 1;
+extern int random_seed;
+
int myrand(void) {
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)
}
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);
UpdateCounter(fullPowerUpName,&powerUps,0);
+ dump_directory_tree(fullPathName);
while(1){
UpdateCounter(fullStartName, &cycleStarts,0);
while(1){
UpdateCounter(fullStartName, &cycleStarts,0);
+ dump_directory_tree(fullPathName);
DoVerifyMainFile();
DoUpdateMainFile();
dump_directory_tree(fullPathName);
UpdateCounter(fullEndName,&cycleEnds,0);
DoVerifyMainFile();
DoUpdateMainFile();
dump_directory_tree(fullPathName);
UpdateCounter(fullEndName,&cycleEnds,0);
+ dump_directory_tree(fullPathName);
}
}
}
}