Skip to content

Commit 4ac2d11

Browse files
de-nordicnashif
authored andcommitted
tests: fs: multifs: 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 2eb992a commit 4ac2d11

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

tests/subsys/fs/multi-fs/src/test_common_dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ int test_mkdir(const char *dir_path, const char *file)
1919
struct fs_file_t filep;
2020
char file_path[PATH_MAX] = { 0 };
2121

22+
fs_file_t_init(&filep);
2223
res = sprintf(file_path, "%s/%s", dir_path, file);
2324
__ASSERT_NO_MSG(res < sizeof(file_path));
2425

@@ -48,6 +49,7 @@ int test_mkdir(const char *dir_path, const char *file)
4849
TC_PRINT("Testing write to file %s\n", file_path);
4950
res = test_file_write(&filep, "NOTHING");
5051
if (res) {
52+
fs_close(&filep);
5153
return res;
5254
}
5355

tests/subsys/fs/multi-fs/src/test_fat_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ static const char *test_str = "Hello world FAT";
1414

1515
void test_fat_open(void)
1616
{
17+
fs_file_t_init(&test_file);
1718
zassert_true(test_file_open(&test_file, TEST_FILE_PATH) == TC_PASS,
1819
NULL);
1920
}

tests/subsys/fs/multi-fs/src/test_littlefs_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ static const char *test_str = "Hello world LITTLEFS";
1414

1515
void test_littlefs_open(void)
1616
{
17+
fs_file_t_init(&test_file);
1718
zassert_true(test_file_open(&test_file, TEST_FILE_PATH) == TC_PASS,
1819
NULL);
1920
}

0 commit comments

Comments
 (0)