test: implement __wrap_is_group_erased() and __wrap_find_block()
This commit is contained in:
parent
bbfb9ca800
commit
0da262cc0f
2 changed files with 28 additions and 0 deletions
|
@ -11,5 +11,7 @@ TEST_CFLAGS += -Dflash_read=__wrap_flash_read
|
|||
TEST_CFLAGS += -Dflash_write=__wrap_flash_write
|
||||
TEST_CFLAGS += -Dflash_is_erased=__wrap_flash_is_erased
|
||||
|
||||
TEST_CFLAGS += -Dis_group_erased=__wrap_is_group_erased
|
||||
TEST_CFLAGS += -Dfind_block=__wrap_find_block
|
||||
TEST_CFLAGS += -Dprepare_head=__wrap_prepare_head
|
||||
TEST_CFLAGS += -Dwrite_page_desc=__wrap_write_page_desc
|
||||
|
|
|
@ -9,6 +9,32 @@
|
|||
|
||||
#include <ftl.h>
|
||||
|
||||
int __wrap_is_group_erased(struct ftl_map *map, uint32_t group)
|
||||
{
|
||||
check_expected_ptr(map);
|
||||
check_expected(group);
|
||||
|
||||
return mock_type(int);
|
||||
}
|
||||
|
||||
int __wrap_find_block(struct ftl_map *map, struct ftl_page_group *group,
|
||||
uint32_t *where, uint32_t block)
|
||||
{
|
||||
struct ftl_page_group *ret_group;
|
||||
|
||||
check_expected_ptr(map);
|
||||
check_expected(block);
|
||||
|
||||
ret_group = mock_type(struct ftl_page_group *);
|
||||
|
||||
if (ret_group)
|
||||
memcpy(group, ret_group, sizeof *group);
|
||||
|
||||
*where = mock_type(uint32_t);
|
||||
|
||||
return mock_type(int);
|
||||
}
|
||||
|
||||
int __wrap_prepare_head(struct ftl_map *map)
|
||||
{
|
||||
(void)map;
|
||||
|
|
Loading…
Add table
Reference in a new issue