Skip to content

Commit d2e1196

Browse files
author
Deepika
committed
Revert "rand() by default does increment of 1, randomizing more"
This reverts commit f7a6d25.
1 parent f33fc3a commit d2e1196

File tree

2 files changed

+4
-6
lines changed
  • components/storage/blockdevice/COMPONENT_SPIF/TESTS/block_device/spif
  • features/storage/TESTS/blockdevice/general_block_device

2 files changed

+4
-6
lines changed

components/storage/blockdevice/COMPONENT_SPIF/TESTS/block_device/spif/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ void basic_erase_program_read_test(SPIFBlockDevice &block_device, bd_size_t bloc
4949
_mutex->lock();
5050

5151
// Make sure block address per each test is unique
52-
static unsigned block_seed = SPIF_TEST_NUM_OF_THREADS;
53-
srand(block_seed);
54-
block_seed += 2;
52+
static unsigned block_seed = 1;
53+
srand(block_seed++);
5554

5655
// Find a random block
5756
bd_addr_t block = (rand() * block_size) % block_device.size();

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ void basic_erase_program_read_test(BlockDevice *block_device, bd_size_t block_si
189189
_mutex->lock();
190190

191191
// Make sure block address per each test is unique
192-
static unsigned block_seed = TEST_NUM_OF_THREADS;
193-
srand(block_seed);
194-
block_seed += 2;
192+
static unsigned block_seed = 1;
193+
srand(block_seed++);
195194

196195
// Find a random block
197196
bd_addr_t block = (rand() * block_size) % (block_device->size());

0 commit comments

Comments
 (0)