Skip to content

rand() and srand() are made sparse to not have same block. #9820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ void basic_erase_program_read_test(SPIFBlockDevice &block_device, bd_size_t bloc
_mutex->lock();

// Make sure block address per each test is unique
static unsigned block_seed = 1;
srand(block_seed++);
static unsigned block_seed = SPIF_TEST_NUM_OF_THREADS;
srand(block_seed);
block_seed += 2;

// Find a random block
bd_addr_t block = (rand() * block_size) % block_device.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ void basic_erase_program_read_test(BlockDevice *block_device, bd_size_t block_si
_mutex->lock();

// Make sure block address per each test is unique
static unsigned block_seed = 1;
srand(block_seed++);
static unsigned block_seed = TEST_NUM_OF_THREADS;
srand(block_seed);
block_seed += 2;

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