Skip to content

Commit a1b1fa0

Browse files
de-nordicnashif
authored andcommitted
tests: fs: fatfs: Add fs_file_t type variable initializations
The commit adds initializations of fs_file_t variables in preparation for fs_open function change that will require fs_file_t object, passed to the function, to be initialized before first usage. Signed-off-by: Dominik Ermel <[email protected]>
1 parent fd61084 commit a1b1fa0

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

tests/subsys/fs/fat_fs_api/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const char *test_fs_open_flags_file_path = FATFS_MNTP"/the_file.txt";
1111

1212
void test_main(void)
1313
{
14+
fs_file_t_init(&filep);
15+
1416
ztest_test_suite(fat_fs_basic_test,
1517
ztest_unit_test(test_fat_mount),
1618
ztest_unit_test(test_fat_file),

tests/subsys/fs/fat_fs_api/src/test_fat_rd_only_mount.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static void test_prepare(void)
2222
{
2323
struct fs_file_t fs;
2424

25+
fs_file_t_init(&fs);
2526
zassert_equal(fs_mount(&fatfs_mnt), 0, NULL);
2627
zassert_equal(fs_open(&fs, "/NAND:/testfile.txt", FS_O_CREATE),
2728
0, NULL);
@@ -38,6 +39,8 @@ static void test_ops_on_rd(void)
3839
{
3940
struct fs_file_t fs;
4041
int ret;
42+
43+
fs_file_t_init(&fs);
4144
/* Check fs operation on volume mounted with FS_MOUNT_FLAG_READ_ONLY */
4245
fatfs_mnt.flags = FS_MOUNT_FLAG_READ_ONLY;
4346
TC_PRINT("Mount as read-only\n");

tests/subsys/fs/fat_fs_api/src/test_fat_rename.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ static int create_file(const char *path)
2525
{
2626
struct fs_file_t fp;
2727
int res = 0;
28+
29+
fs_file_t_init(&fp);
2830
if (!check_file_dir_exists(path)) {
2931
res = fs_open(&fp, path, FS_O_CREATE | FS_O_RDWR);
3032
if (!res) {

tests/subsys/fs/fat_fs_dual_drive/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
void test_main(void)
1717
{
18+
fs_file_t_init(&filep);
19+
1820
ztest_test_suite(fat_fs_basic_test,
1921
ztest_unit_test(test_fat_mount),
2022
ztest_unit_test(test_fat_file),

0 commit comments

Comments
 (0)