Skip to content

Commit 2d77a99

Browse files
committed
[nrf noup] tests/flash_map: Amend for Partition Manager
Partition Manager does not have concept of disabled partitions, it just does not generate them, so it is not possible to test for disabled partitions. Partition reference by node tests have also been disabled for Partition Manager as nodes are DTS concept that Partition Manager does not support. Signed-off-by: Dominik Ermel <[email protected]>
1 parent ce7b5e8 commit 2d77a99

File tree

1 file changed

+8
-0
lines changed
  • tests/subsys/storage/flash_map/src

1 file changed

+8
-0
lines changed

tests/subsys/storage/flash_map/src/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
extern int flash_map_entries;
2424
struct flash_sector fs_sectors[2048];
2525

26+
/* Partition Manager does not have concept of disabled devices
27+
* and so does not generate entries for them, into flash map.
28+
*/
29+
#if USE_PARTITION_MANAGER == 0
2630
ZTEST(flash_map, test_flash_area_disabled_device)
2731
{
2832
const struct flash_area *fa;
@@ -54,6 +58,7 @@ ZTEST(flash_map, test_flash_area_device_is_ready)
5458
zassert_true(flash_area_device_is_ready(
5559
FIXED_PARTITION(SLOT1_PARTITION)));
5660
}
61+
#endif
5762

5863
static void layout_match(const struct device *flash_dev, uint32_t sec_cnt)
5964
{
@@ -142,6 +147,8 @@ ZTEST(flash_map, test_flash_area_erased_val)
142147
"value different than the flash erase value");
143148
}
144149

150+
/* Partition Manager does not have concept of nodes, like DTS does */
151+
#if USE_PARTITION_MANAGER == 0
145152
ZTEST(flash_map, test_fixed_partition_node_macros)
146153
{
147154
/* Test against changes in API */
@@ -156,6 +163,7 @@ ZTEST(flash_map, test_fixed_partition_node_macros)
156163
zassert_equal(FIXED_PARTITION_BY_NODE(DT_NODELABEL(SLOT1_PARTITION)),
157164
FIXED_PARTITION(SLOT1_PARTITION));
158165
}
166+
#endif
159167

160168
ZTEST(flash_map, test_flash_area_erase_and_flatten)
161169
{

0 commit comments

Comments
 (0)