Add dummy uses for unused variables to clear compilation warnings
[yaffs2.git] / direct / tests / nor_stress.c
index 033700ddeea3177d56a3d2f9066f8d7bf343dc77..5a7b5297fde80cce4d16f673e018ff6c1abc75c9 100644 (file)
@@ -27,6 +27,8 @@ do { \
 #endif
 
 
+void (*ext_fatal)(void) = NULL;
+
 static unsigned powerUps;
 static unsigned cycleStarts;
 static unsigned cycleEnds;
@@ -71,6 +73,9 @@ void MakeFullNames(const char *prefix)
 static void FatalError(int lineNo)
 {
   printf("Integrity error %d\n",lineNo);
+  if(ext_fatal)
+       ext_fatal();
+       
   while(1){
    sleep(1);
   }
@@ -152,6 +157,7 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
        yaffs_dirent *de;
        struct yaffs_stat s;
        char str[1000];
+       int error_line = 0;
                        
        d = yaffs_opendir(dname);
        
@@ -172,7 +178,7 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
                        printf("%s inode %ld %d obj %x length %d mode %X ",str, de->d_ino, s.st_ino,de->d_dont_use,(int)s.st_size,s.st_mode);\
                        if(de->d_ino != s.st_ino){
                                printf(" \n\n!!!! HEY inode mismatch\n\n");
-                               FatalError(__LINE__);
+                               error_line = __LINE__;
                        }
 
                        switch(s.st_mode & S_IFMT)
@@ -194,10 +200,13 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
                                dump_directory_tree_worker(str,1);
                                
                         if(s.st_ino > 10000)
-                          FatalError(__LINE__);
+                          error_line = __LINE__;
                                                        
                }
                
+               if(error_line)
+                       FatalError(error_line);
+               
                yaffs_closedir(d);
        }