+static int eraseDisplayEnabled;
+
+static int markedBadBlocks[] = { 1, 4, -1};
+
+static int IsAMarkedBadBlock(int blk)
+{
+#if YAFFS_ERROR_TESTING
+ int *m = markedBadBlocks;
+
+ while(*m >= 0)
+ {
+ if(*m == blk) return 1;
+ m++;
+ }
+#endif
+ return 0;
+}
+
+
+static __u8 yaffs_WriteFailCorruption(int chunkInNAND)
+{
+#if YAFFS_ERROR_TESTING
+
+ // Whole blocks that fail
+ switch(chunkInNAND/YAFFS_CHUNKS_PER_BLOCK)
+ {
+ case 50:
+ case 52:
+ return 7;
+ }
+
+ // Single blocks that fail
+ switch(chunkInNAND)
+ {
+ case 2000:
+ case 2003:
+ case 3000:
+ case 3001:
+ return 3;// ding two bits
+ case 2001:
+ case 3003:
+ case 3004:
+ case 3005:
+ case 3006:
+ case 3007: return 1;// ding one bit
+
+
+ }
+#endif
+ return 0;
+}