Skip to content

Commit d25572e

Browse files
rruuaanngfabiobaltieri
authored andcommitted
tests: subsys: fs: Add FSTAB_ENTRY_DT_*_MOUNT_POINT unit test
Add unit tests for `FSTAB_ENTRY_DT_MOUNT_POINT` and `FSTAB_ENTRY_DT_INST_MOUNT_POINT` macros. Signed-off-by: James Roy <[email protected]>
1 parent 889a713 commit d25572e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/subsys/fs/fs_api/app.overlay

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
3+
/ {
4+
test_disk: disk {
5+
compatible = "zephyr,fstab,fatfs";
6+
mount-point = "/TEST:";
7+
};
8+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2025 James Roy <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#define DT_DRV_COMPAT zephyr_fstab_fatfs
8+
#include "test_fs.h"
9+
10+
#define TEST_NODELABEL DT_NODELABEL(test_disk)
11+
12+
ZTEST(test_fs_dt_api, test_dt_api_mount_point)
13+
{
14+
const char *mnt_point1, *mnt_point2;
15+
16+
mnt_point1 = FSTAB_ENTRY_DT_MOUNT_POINT(TEST_NODELABEL);
17+
zassert_str_equal(mnt_point1, "/TEST:");
18+
19+
mnt_point2 = FSTAB_ENTRY_DT_INST_MOUNT_POINT(0);
20+
zassert_str_equal(mnt_point2, "/TEST:");
21+
}
22+
23+
ZTEST_SUITE(test_fs_dt_api, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)