projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs testing: Change plotting to check for null data
[yaffs2.git]
/
direct
/
tests
/
nor_stress.c
diff --git
a/direct/tests/nor_stress.c
b/direct/tests/nor_stress.c
index bb614d8481363b380a48850aefee081908f01269..730bd4353c088255a8443867c53bc17bbc37fbff 100644
(file)
--- a/
direct/tests/nor_stress.c
+++ b/
direct/tests/nor_stress.c
@@
-21,6
+21,7
@@
#include <stdio.h>
#include <stdio.h>
+extern int fuzz_test;
#if 1
#define FSX_INIT(mount_pt) do{ if(interleave_fsx) yaffs_fsx_init(mount_pt); } while(0)
#if 1
#define FSX_INIT(mount_pt) do{ if(interleave_fsx) yaffs_fsx_init(mount_pt); } while(0)
@@
-86,9
+87,13
@@
void MakeFullNames(const char *prefix)
MakeName(fullTempMainName,prefix,"tmp-main");
}
MakeName(fullTempMainName,prefix,"tmp-main");
}
-static void FatalError(int line
N
o)
+static void FatalError(int line
_n
o)
{
{
- printf("Integrity error %d\n",lineNo);
+ printf("Integrity error %d\n",line_no);
+
+ if(fuzz_test)
+ return;
+
if(ext_fatal)
ext_fatal();
if(ext_fatal)
ext_fatal();
@@
-177,6
+182,7
@@
static void dump_directory_tree_worker(const char *dname,int recursive)
struct yaffs_stat s;
char str[1000];
int error_line = 0;
struct yaffs_stat s;
char str[1000];
int error_line = 0;
+ int nentries;
d = yaffs_opendir(dname);
d = yaffs_opendir(dname);
@@
-186,11
+192,13
@@
static void dump_directory_tree_worker(const char *dname,int recursive)
}
else
{
}
else
{
+ nentries = 0;
while((de = yaffs_readdir(d)) != NULL)
{
strcpy(str,dname);
strcat(str,"/");
strcat(str,de->d_name);
while((de = yaffs_readdir(d)) != NULL)
{
strcpy(str,dname);
strcat(str,"/");
strcat(str,de->d_name);
+ nentries++;
yaffs_lstat(str,&s);
yaffs_lstat(str,&s);
@@
-219,10
+227,15
@@
static void dump_directory_tree_worker(const char *dname,int recursive)
dump_directory_tree_worker(str,1);
if(s.st_ino > 10000)
dump_directory_tree_worker(str,1);
if(s.st_ino > 10000)
- error_line = __LINE__;
+
error_line = __LINE__;
}
}
+ if(strstr(dname,"lost+found") && nentries >0){
+ printf("\n\n!!! HEY lost+found not empty, had %d entries\n\n\n",nentries);
+ error_line = __LINE__;
+ }
+
if(error_line && !no_verification)
FatalError(error_line);
if(error_line && !no_verification)
FatalError(error_line);
@@
-245,7
+258,7
@@
static void dump_directory_tree(const char *dname)
static unsigned xx[XX_SIZE];
static unsigned xx[XX_SIZE];
-static int y
WriteF
ile(const char *fname, unsigned sz32)
+static int y
_wr_f
ile(const char *fname, unsigned sz32)
{
int h;
int r;
{
int h;
int r;
@@
-304,7
+317,7
@@
WRITE_ERROR:
}
}
-static int y
VerifyF
ile(const char *fName)
+static int y
_verify_f
ile(const char *fName)
{
unsigned checksum = 0;
unsigned totalSize;
{
unsigned checksum = 0;
unsigned totalSize;
@@
-387,7
+400,7
@@
static void DoUpdateMainFile(void)
int sz32;
sz32 = (myrand() % 1000) + 20;
int sz32;
sz32 = (myrand() % 1000) + 20;
- result = y
WriteF
ile(fullTempMainName,sz32);
+ result = y
_wr_f
ile(fullTempMainName,sz32);
FSX();
if(!no_verification && result)
FatalError(__LINE__);
FSX();
if(!no_verification && result)
FatalError(__LINE__);
@@
-401,7
+414,7
@@
static void DoVerifyMainFile(void)
int result;
if(no_verification)
return;
int result;
if(no_verification)
return;
- result = y
VerifyF
ile(fullMainName);
+ result = y
_verify_f
ile(fullMainName);
if(result)
FatalError(__LINE__);
if(result)
FatalError(__LINE__);