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/fcb.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 struct fcb_entry loc;
15
16 memset(&loc, 0, sizeof(struct fcb_entry));
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 loc.fe_sector = NULL;
23 rc = fcb_getnext((struct fcb *)storage, &loc);
24
25 zassert_equal(rc, 0, "Can't read fcb (err=%d)", rc);
26 }
27 ZTEST_SUITE(settings_functional, NULL, NULL, NULL, NULL, NULL);
28