1 /* SPDX-License-Identifier: Apache-2.0 */
2 /* Copyright (c) 2022 Nordic semiconductor ASA */
3 
4 #include <zephyr/kernel.h>
5 #include <zephyr/ztest.h>
6 #include <errno.h>
7 #include <zephyr/settings/settings.h>
8 #include <zephyr/fs/fs.h>
9 
ZTEST(settings_functional,test_setting_storage_get)10 ZTEST(settings_functional, test_setting_storage_get)
11 {
12 	int rc;
13 	void *storage;
14 
15 	struct fs_dirent entry;
16 
17 	rc = settings_storage_get(&storage);
18 	zassert_equal(0, rc, "Can't fetch storage reference (err=%d)", rc);
19 
20 	zassert_not_null(storage, "Null reference.");
21 
22 	rc = fs_stat((const char *)storage, &entry);
23 
24 	zassert_true(rc >= 0, "Can't find the file (err=%d)", rc);
25 }
26 ZTEST_SUITE(settings_functional, NULL, NULL, NULL, NULL, NULL);
27