Fix no block device handling

pull/8637/head
Amir Cohen 2018-10-23 16:41:54 +03:00 committed by Cruz Monrreal II
parent 65a4287da2
commit c87f44e00e
2 changed files with 11 additions and 1 deletions

View File

@ -32,7 +32,7 @@ mbed test -m K64F -t ARM -n mbed-os-features-storage-tests-blockdevice-general_b
Use `mbed test` again: Use `mbed test` again:
``` ```
mbed test -m K64F -t ARM -n mbed-os-features-storage-tests-blockdevice-general_block_device --run mbed test -m K64F -t ARM -n mbed-os-features-storage-tests-blockdevice-general_block_device --run -v
``` ```
#### Troubleshooting #### Troubleshooting

View File

@ -95,6 +95,11 @@ void test_random_program_read_erase()
BlockDevice *block_device = BlockDevice::get_default_instance(); BlockDevice *block_device = BlockDevice::get_default_instance();
if (!block_device) {
utest_printf("\nno block device found.\n");
return;
}
int err = block_device->init(); int err = block_device->init();
TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(0, err);
@ -164,6 +169,11 @@ void test_multi_threads()
BlockDevice *block_device = BlockDevice::get_default_instance(); BlockDevice *block_device = BlockDevice::get_default_instance();
if (!block_device) {
utest_printf("\nno block device found.\n");
return;
}
int err = block_device->init(); int err = block_device->init();
TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(0, err);