[TESTS] Add memory check for RAM constraint device

pull/12623/head
toyowata 2020-04-30 14:16:40 +09:00
parent 41435a0807
commit 5a57670121
4 changed files with 17 additions and 15 deletions

View File

@ -45,6 +45,11 @@ extern uint32_t mbed_stack_isr_size;
#define EXPECTED_USER_THREAD_DEFAULT_STACK_SIZE (4096)
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (EXPECTED_MAIN_THREAD_STACK_SIZE + EXPECTED_ISR_STACK_SIZE))
#error [NOT_SUPPORTED] Insufficient stack for staci_size_unification tests
#endif
/* Test sizes of ISR stack, main thread stack, default user thread stack.
*
* On some platforms with lower RAM size (e.g. NUCLEO_F070RB - 16 KB RAM) it is impossible

View File

@ -23,16 +23,15 @@
using namespace utest::v1;
// TODO HACK, replace with available ram/heap property
#if defined(TARGET_LPC1114)
#error [NOT_SUPPORTED] Insufficient heap for heap block device tests
#else
#define TEST_BLOCK_SIZE 128
#define TEST_BLOCK_DEVICE_SIZE 32*TEST_BLOCK_SIZE
#define TEST_BLOCK_COUNT 10
#define TEST_ERROR_MASK 16
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= TEST_BLOCK_DEVICE_SIZE)
#error [NOT_SUPPORTED] Insufficient heap for heap block device tests
#endif
const struct {
const char *name;
bd_size_t (BlockDevice::*method)() const;

View File

@ -24,14 +24,13 @@
using namespace utest::v1;
// TODO HACK, replace with available ram/heap property
#if defined(TARGET_LPC1114)
#error [NOT_SUPPORTED] Insufficient heap for heap block device tests
#else
#define BLOCK_COUNT 16
#define BLOCK_SIZE 512
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (BLOCK_COUNT * BLOCK_SIZE))
#error [NOT_SUPPORTED] Insufficient heap for mbr block device tests
#endif
HeapBlockDevice bd(BLOCK_COUNT *BLOCK_SIZE, BLOCK_SIZE);
// Testing formatting of master boot record

View File

@ -26,14 +26,13 @@
using namespace utest::v1;
// TODO HACK, replace with available ram/heap property
#if defined(TARGET_LPC1114)
#error [NOT_SUPPORTED] Insufficient heap for heap block device tests
#else
#define BLOCK_COUNT 16
#define BLOCK_SIZE 512
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (BLOCK_COUNT * BLOCK_SIZE))
#error [NOT_SUPPORTED] Insufficient heap for util block device tests
#endif
// Simple test which read/writes blocks on a sliced block device
void test_slicing()