1 /*
2  * Copyright (c) 2018 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/fs/fs.h>
8 #include "test_common.h"
9 #include "test_fat.h"
10 #include "test_fat_priv.h"
11 
12 static struct fs_file_t test_file;
13 static const char *test_str = "Hello world FAT";
14 
test_fat_open(void)15 void test_fat_open(void)
16 {
17 	fs_file_t_init(&test_file);
18 	zassert_true(test_file_open(&test_file, TEST_FILE_PATH) == TC_PASS);
19 }
20 
test_fat_write(void)21 void test_fat_write(void)
22 {
23 	TC_PRINT("Write to file %s\n", TEST_FILE_PATH);
24 	zassert_true(test_file_write(&test_file, test_str) == TC_PASS);
25 }
26 
test_fat_read(void)27 void test_fat_read(void)
28 {
29 	zassert_true(test_file_read(&test_file, test_str) == TC_PASS);
30 }
31 
test_fat_close(void)32 void test_fat_close(void)
33 {
34 	zassert_true(test_file_close(&test_file) == TC_PASS);
35 }
test_fat_unlink(void)36 void test_fat_unlink(void)
37 {
38 	zassert_true(test_file_delete(TEST_FILE_PATH) == TC_PASS);
39 }
40