projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More changes to test harness
[yaffs2.git]
/
direct
/
yaffs_fileem2k.c
diff --git
a/direct/yaffs_fileem2k.c
b/direct/yaffs_fileem2k.c
index 8b4b46142b914cbc44d3159b9b8eb5602f330fcd..47437d537887032b56d7615cb9239b352c4be305 100644
(file)
--- a/
direct/yaffs_fileem2k.c
+++ b/
direct/yaffs_fileem2k.c
@@
-15,7
+15,7
@@
// This provides a YAFFS nand emulation on a file for emulating 2kB pages.
// THis is only intended as test code to test persistence etc.
// This provides a YAFFS nand emulation on a file for emulating 2kB pages.
// THis is only intended as test code to test persistence etc.
-const char *yaffs_flashif_c_version = "$Id: yaffs_fileem2k.c,v 1.
8 2006-11-07 23:37:43
charles Exp $";
+const char *yaffs_flashif_c_version = "$Id: yaffs_fileem2k.c,v 1.
9 2006-11-08 09:49:47
charles Exp $";
#include "yportenv.h"
#include "yportenv.h"
@@
-32,7
+32,7
@@
const char *yaffs_flashif_c_version = "$Id: yaffs_fileem2k.c,v 1.8 2006-11-07 23
#include "yaffs_fileem2k.h"
#include "yaffs_packedtags2.h"
#include "yaffs_fileem2k.h"
#include "yaffs_packedtags2.h"
-
//
#define SIMULATE_FAILURES
+#define SIMULATE_FAILURES
typedef struct
{
typedef struct
{
@@
-164,6
+164,15
@@
int yflash_WriteChunkWithTagsToNAND(yaffs_Device *dev,int chunkInNAND,const __u8
exit(1);
}
exit(1);
}
+#ifdef SIMULATE_FAILURES
+ if((chunkInNAND >> 6) == 100)
+ written = 0;
+
+ if((chunkInNAND >> 6) == 110)
+ written = 0;
+#endif
+
+
if(written != dev->nDataBytesPerChunk) return YAFFS_FAIL;
}
if(written != dev->nDataBytesPerChunk) return YAFFS_FAIL;
}
@@
-257,14
+266,14
@@
int yflash_ReadChunkWithTagsFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *da
nread= read(h,&pt,sizeof(pt));
yaffs_UnpackTags2(tags,&pt);
#ifdef SIMULATE_FAILURES
nread= read(h,&pt,sizeof(pt));
yaffs_UnpackTags2(tags,&pt);
#ifdef SIMULATE_FAILURES
- if((chunkInNAND >> 6) ==
3
00) {
+ if((chunkInNAND >> 6) ==
1
00) {
if(fail300 && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR){
tags->eccResult = YAFFS_ECC_RESULT_FIXED;
fail300 = 0;
}
}
if(fail300 && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR){
tags->eccResult = YAFFS_ECC_RESULT_FIXED;
fail300 = 0;
}
}
- if((chunkInNAND >> 6) ==
32
0) {
+ if((chunkInNAND >> 6) ==
11
0) {
if(fail320 && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR){
tags->eccResult = YAFFS_ECC_RESULT_FIXED;
fail320 = 0;
if(fail320 && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR){
tags->eccResult = YAFFS_ECC_RESULT_FIXED;
fail320 = 0;