skip the flashsim test if enough memory cannot be allocated for it.

pull/8341/head
Aashish chaddha 2018-08-03 13:33:04 -05:00 committed by adbridge
parent 16b34ca82f
commit ec18321551
1 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,11 @@ static const uint8_t blank = 0xFF;
// Simple test for all APIs
void functionality_test()
{
uint8_t *dummy = new (std::nothrow) uint8_t[num_blocks * erase_size];
TEST_SKIP_UNLESS_MESSAGE(dummy, "Not enough memory for test");
delete[] dummy;
HeapBlockDevice heap_bd(num_blocks * erase_size, read_size, prog_size, erase_size);
FlashSimBlockDevice bd(&heap_bd, blank);