tests: fs: Add test case for LFN with FATFS
Rerun the same test but with CONFIG_FS_FATFS_LFN=Y and with a long filename. Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
This commit is contained in:
parent
5f05d6598f
commit
70df7a87a1
4 changed files with 25 additions and 0 deletions
12
tests/subsys/fs/fat_fs_api/prj_lfn.conf
Normal file
12
tests/subsys/fs/fat_fs_api/prj_lfn.conf
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
CONFIG_FILE_SYSTEM=y
|
||||||
|
CONFIG_LOG=y
|
||||||
|
CONFIG_FAT_FILESYSTEM_ELM=y
|
||||||
|
CONFIG_FS_FATFS_LFN=y
|
||||||
|
CONFIG_DISK_ACCESS_FLASH=y
|
||||||
|
CONFIG_DISK_FLASH_DEV_NAME="flash_ctrl"
|
||||||
|
CONFIG_DISK_FLASH_START=0
|
||||||
|
CONFIG_DISK_FLASH_MAX_RW_SIZE=256
|
||||||
|
CONFIG_DISK_ERASE_BLOCK_SIZE=0x1000
|
||||||
|
CONFIG_DISK_FLASH_ERASE_ALIGNMENT=0x1000
|
||||||
|
CONFIG_DISK_VOLUME_SIZE=0x200000
|
||||||
|
CONFIG_ZTEST=y
|
|
@ -9,7 +9,12 @@
|
||||||
#include <fs/fs.h>
|
#include <fs/fs.h>
|
||||||
|
|
||||||
#define FATFS_MNTP "/NAND:"
|
#define FATFS_MNTP "/NAND:"
|
||||||
|
#if IS_ENABLED(CONFIG_FS_FATFS_LFN)
|
||||||
|
#define TEST_FILE FATFS_MNTP \
|
||||||
|
"/testlongfilenamethatsmuchlongerthan8.3chars.text"
|
||||||
|
#else
|
||||||
#define TEST_FILE FATFS_MNTP"/testfile.txt"
|
#define TEST_FILE FATFS_MNTP"/testfile.txt"
|
||||||
|
#endif /* IS_ENABLED(CONFIG_FS_FATFS_LFN) */
|
||||||
#define TEST_DIR FATFS_MNTP"/testdir"
|
#define TEST_DIR FATFS_MNTP"/testdir"
|
||||||
#define TEST_DIR_FILE FATFS_MNTP"/testdir/testfile.txt"
|
#define TEST_DIR_FILE FATFS_MNTP"/testdir/testfile.txt"
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,10 @@ static int test_file_open(void)
|
||||||
|
|
||||||
TC_PRINT("Opened file %s\n", TEST_FILE);
|
TC_PRINT("Opened file %s\n", TEST_FILE);
|
||||||
|
|
||||||
|
if (check_file_dir_exists(TEST_FILE)) {
|
||||||
|
TC_PRINT("File now exists %s\n", TEST_FILE);
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,3 +2,7 @@ tests:
|
||||||
filesystem.fat.api:
|
filesystem.fat.api:
|
||||||
platform_whitelist: native_posix
|
platform_whitelist: native_posix
|
||||||
tags: filesystem
|
tags: filesystem
|
||||||
|
filesystem.fat.api.lfn:
|
||||||
|
extra_args: CONF_FILE="prj_lfn.conf"
|
||||||
|
platform_whitelist: native_posix
|
||||||
|
tags: filesystem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue