1 /*
2  * Copyright (c) 2017-2023 Nordic Semiconductor ASA
3  * Copyright (c) 2015 Runtime Inc
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef _FCB_TEST_H
9 #define _FCB_TEST_H
10 
11 #include <stdio.h>
12 #include <string.h>
13 #include <zephyr/ztest.h>
14 
15 #include <zephyr/fs/fcb.h>
16 #include "fcb_priv.h"
17 #include <errno.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define TEST_FCB_FLASH_AREA		slot1_partition
24 #define TEST_FCB_FLASH_AREA_ID		FIXED_PARTITION_ID(TEST_FCB_FLASH_AREA)
25 
26 extern struct fcb test_fcb;
27 #if defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER)
28 extern struct fcb test_fcb_crc_disabled;
29 #endif
30 
31 extern struct flash_sector test_fcb_sector[];
32 
33 extern uint8_t fcb_test_erase_value;
34 
35 struct append_arg {
36 	int *elem_cnts;
37 };
38 
39 void test_fcb_wipe(void);
40 int fcb_test_empty_walk_cb(struct fcb_entry_ctx *entry_ctx, void *arg);
41 uint8_t fcb_test_append_data(int msg_len, int off);
42 int fcb_test_data_walk_cb(struct fcb_entry_ctx *entry_ctx, void *arg);
43 int fcb_test_cnt_elems_cb(struct fcb_entry_ctx *entry_ctx, void *arg);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif /* _FCB_TEST_H */
49