Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/emubd
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2019-07-24 22:19:39 +0300
committerChristopher Haster <chaster@utexas.edu>2019-07-27 03:50:17 +0300
commitef1c926940f176b20078e56ae4dddd268d9c0497 (patch)
tree36b86f76641e292c3e9f804c35fd0a8e2ff77fd5 /emubd
parent649640c605a41fb1a8cb4cbaa4a620e9edbedbd6 (diff)
Increased testing to include geometries that can't be fully tested
This is primarily to get better test coverage over devices with very large erase/prog/read sizes. The unfortunate state of the tests is that most of them rely on a specific block device size, so that ENOSPC and ECORRUPT errors occur in specific situations. This should be improved in the future, but at least for now we can open up some of the simpler tests to run on these different configurations. Also added testing over both 0x00 and 0xff erase values in emubd. Also added a number of small file tests that expose issues prevalent on NAND devices.
Diffstat (limited to 'emubd')
-rw-r--r--emubd/lfs_emubd.c2
-rw-r--r--emubd/lfs_emubd.h16
2 files changed, 3 insertions, 15 deletions
diff --git a/emubd/lfs_emubd.c b/emubd/lfs_emubd.c
index 3f31bfa..3c77945 100644
--- a/emubd/lfs_emubd.c
+++ b/emubd/lfs_emubd.c
@@ -83,7 +83,7 @@ int lfs_emubd_create(const struct lfs_config *cfg, const char *path) {
snprintf(emu->child, LFS_NAME_MAX, ".stats");
FILE *f = fopen(emu->path, "r");
if (!f) {
- memset(&emu->stats, 0, sizeof(emu->stats));
+ memset(&emu->stats, LFS_EMUBD_ERASE_VALUE, sizeof(emu->stats));
} else {
size_t res = fread(&emu->stats, sizeof(emu->stats), 1, f);
lfs_emubd_fromle32(emu);
diff --git a/emubd/lfs_emubd.h b/emubd/lfs_emubd.h
index 64afa3e..0fd78c1 100644
--- a/emubd/lfs_emubd.h
+++ b/emubd/lfs_emubd.h
@@ -17,20 +17,8 @@ extern "C"
// Config options
-#ifndef LFS_EMUBD_READ_SIZE
-#define LFS_EMUBD_READ_SIZE 1
-#endif
-
-#ifndef LFS_EMUBD_PROG_SIZE
-#define LFS_EMUBD_PROG_SIZE 1
-#endif
-
-#ifndef LFS_EMUBD_ERASE_SIZE
-#define LFS_EMUBD_ERASE_SIZE 512
-#endif
-
-#ifndef LFS_EMUBD_TOTAL_SIZE
-#define LFS_EMUBD_TOTAL_SIZE 524288
+#ifndef LFS_EMUBD_ERASE_VALUE
+#define LFS_EMUBD_ERASE_VALUE 0x00
#endif