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 extern struct fcb test_fcb_crc_disabled;
28 
29 extern struct flash_sector test_fcb_sector[];
30 
31 extern uint8_t fcb_test_erase_value;
32 
33 struct append_arg {
34 	int *elem_cnts;
35 };
36 
37 void test_fcb_wipe(void);
38 int fcb_test_empty_walk_cb(struct fcb_entry_ctx *entry_ctx, void *arg);
39 uint8_t fcb_test_append_data(int msg_len, int off);
40 int fcb_test_data_walk_cb(struct fcb_entry_ctx *entry_ctx, void *arg);
41 int fcb_test_cnt_elems_cb(struct fcb_entry_ctx *entry_ctx, void *arg);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 #endif /* _FCB_TEST_H */
47