1 /* Copyright (c) 2024 BayLibre SAS
2  *
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #include <zephyr/kernel.h>
7 #include <zephyr/ztest.h>
8 #include <errno.h>
9 #include <zephyr/settings/settings.h>
10 #include <zephyr/fs/zms.h>
11 
ZTEST(settings_functional,test_setting_storage_get)12 ZTEST(settings_functional, test_setting_storage_get)
13 {
14 	int rc;
15 	void *storage;
16 	uint32_t data = 0xdeadbeefu;
17 
18 	rc = settings_storage_get(&storage);
19 	zassert_equal(0, rc, "Can't fetch storage reference (err=%d)", rc);
20 	zassert_not_null(storage, "Null reference.");
21 
22 	rc = zms_write((struct zms_fs *)storage, 512, &data, sizeof(data));
23 	zassert_true(rc >= 0, "Can't write ZMS entry (err=%d).", rc);
24 }
25 ZTEST_SUITE(settings_functional, NULL, NULL, NULL, NULL, NULL);
26