yaffs Changes to direct tests
[yaffs2.git] / direct / tests / nor_stress.c
index bb614d8481363b380a48850aefee081908f01269..6f6b4ce583c74fee117a81d5fe041b3a98510797 100644 (file)
@@ -21,6 +21,7 @@
 #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)
@@ -89,6 +90,10 @@ void MakeFullNames(const char *prefix)
 static void FatalError(int lineNo)
 {
   printf("Integrity error %d\n",lineNo);
+
+  if(fuzz_test)
+       return;
+
   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;
+       int nentries;
                        
        d = yaffs_opendir(dname);
        
@@ -186,11 +192,13 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
        }
        else
        {
+               nentries = 0;
                while((de = yaffs_readdir(d)) != NULL)
                {
                        strcpy(str,dname);
                        strcat(str,"/");
                        strcat(str,de->d_name);
+                       nentries++;
                        
                        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)
-                          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);