Skip to content

Commit 4bbc2cd

Browse files
author
offirko
committed
Fix general block device test to ensure unique block address per test
1 parent 3252530 commit 4bbc2cd

File tree

1 file changed

+5
-0
lines changed
  • features/storage/TESTS/blockdevice/general_block_device

1 file changed

+5
-0
lines changed

features/storage/TESTS/blockdevice/general_block_device/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ void basic_erase_program_read_test(BlockDevice *block_device, bd_size_t block_si
187187
{
188188
int err = 0;
189189
_mutex->lock();
190+
191+
// Make sure block address per each test is unique
192+
static unsigned block_seed = 1;
193+
srand(block_seed++);
194+
190195
// Find a random block
191196
bd_addr_t block = (rand() * block_size) % (block_device->size());
192197

0 commit comments

Comments
 (0)