1 /*
2  * Copyright (c) 2018 Nordic Semiconductor ASA
3  * Copyright (c) 2015 Runtime Inc
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #include "settings_test.h"
9 #include "settings/settings_fcb.h"
10 
ZTEST(settings_config_fcb,test_config_empty_fcb)11 ZTEST(settings_config_fcb, test_config_empty_fcb)
12 {
13 	int rc;
14 	struct settings_fcb cf;
15 
16 	config_wipe_srcs();
17 	config_wipe_fcb(fcb_sectors, ARRAY_SIZE(fcb_sectors));
18 
19 	cf.cf_fcb.f_magic = CONFIG_SETTINGS_FCB_MAGIC;
20 	cf.cf_fcb.f_sectors = fcb_sectors;
21 	cf.cf_fcb.f_sector_cnt = ARRAY_SIZE(fcb_sectors);
22 
23 	rc = settings_fcb_src(&cf);
24 	zassert_true(rc == 0, "settings_fcb_src call should succeed");
25 
26 	/*
27 	 * No values
28 	 */
29 	settings_load();
30 
31 	config_wipe_srcs();
32 	ctest_clear_call_state();
33 }
34