1 /* 2 * Copyright (c) 2018 Intel Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <fs/fs.h> 8 #include <ff.h> 9 #include "test_fs.h" 10 11 /* FatFs work area */ 12 static FATFS fat_fs; 13 14 /* mounting info */ 15 static struct fs_mount_t fatfs_mnt = { 16 .type = FS_FATFS, 17 .mnt_point = FATFS_MNTP, 18 .fs_data = &fat_fs, 19 }; 20 test_mount(void)21static int test_mount(void) 22 { 23 int res; 24 25 res = fs_mount(&fatfs_mnt); 26 if (res < 0) { 27 TC_PRINT("Error mounting fs [%d]\n", res); 28 return TC_FAIL; 29 } 30 31 return TC_PASS; 32 } 33 34 /** 35 * @brief Test for File System mount operation 36 * 37 * @details Test initializes the fs_mount_t data structure with FatFs 38 * related info and calls the fs_mount API for mount the file system. 39 */ test_fs_mount(void)40void test_fs_mount(void) 41 { 42 zassert_true(test_mount() == TC_PASS, NULL); 43 } 44