1 /*
2  * Copyright (c) 2016 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include "test_fat.h"
8 
test_statvfs(void)9 static int test_statvfs(void)
10 {
11 	struct fs_statvfs stat;
12 	int res;
13 
14 	/* Verify fs_statvfs() */
15 	res = fs_statvfs(FATFS_MNTP, &stat);
16 	if (res) {
17 		TC_PRINT("Error getting volume stats [%d]\n", res);
18 		return res;
19 	}
20 
21 	TC_PRINT("\n");
22 	TC_PRINT("Optimal transfer block size   = %lu\n", stat.f_bsize);
23 	TC_PRINT("Allocation unit size          = %lu\n", stat.f_frsize);
24 	TC_PRINT("Volume size in f_frsize units = %lu\n", stat.f_blocks);
25 	TC_PRINT("Free space in f_frsize units  = %lu\n", stat.f_bfree);
26 
27 	return TC_PASS;
28 }
29 
test_fat_fs(void)30 void test_fat_fs(void)
31 {
32 	zassert_true(test_statvfs() == TC_PASS);
33 }
34