Fix general block device test to ensure unique block address per test

pull/9650/head
offirko 2019-02-10 10:38:46 +02:00
parent 3252530e3a
commit 4bbc2cdc5b
1 changed files with 5 additions and 0 deletions

View File

@ -187,6 +187,11 @@ void basic_erase_program_read_test(BlockDevice *block_device, bd_size_t block_si
{ {
int err = 0; int err = 0;
_mutex->lock(); _mutex->lock();
// Make sure block address per each test is unique
static unsigned block_seed = 1;
srand(block_seed++);
// Find a random block // Find a random block
bd_addr_t block = (rand() * block_size) % (block_device->size()); bd_addr_t block = (rand() * block_size) % (block_device->size());