File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
TESTS/mbedmicro-rtos-mbed/malloc Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1919#include " unity/unity.h"
2020
2121
22- #if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER || !defined(MBED_CONF_RTOS_PRESENT)
22+ #if !DEVICE_USTICKER
2323#error [NOT_SUPPORTED] test not supported
2424#else
2525
2626using utest::v1::Case;
2727
2828extern uint32_t mbed_heap_size;
2929static const int test_timeout = 25 ;
30+ #if defined(MBED_CONF_RTOS_PRESENT)
3031volatile bool thread_should_continue = true ;
3132#define NUM_THREADS 4
3233#define THREAD_MALLOC_SIZE 100
@@ -59,7 +60,7 @@ void task_using_malloc(void)
5960 free (data);
6061 }
6162}
62-
63+ # endif
6364/* * Test for multithreaded heap allocations
6465
6566 Given multiple threads are started in parallel
@@ -68,6 +69,7 @@ void task_using_malloc(void)
6869 */
6970void test_multithread_allocation (void )
7071{
72+ #if defined(MBED_CONF_RTOS_PRESENT)
7173 // static stack for threads to reduce heap usage on devices with small RAM
7274 // and eliminate run out of heap memory problem
7375 uint8_t stack[NUM_THREADS][THREAD_STACK_SIZE];
@@ -101,6 +103,7 @@ void test_multithread_allocation(void)
101103 }
102104 }
103105 TEST_ASSERT_FALSE (thread_alloc_failure);
106+ #endif
104107}
105108
106109/* * Test for multiple heap alloc and free calls */
You can’t perform that action at this time.
0 commit comments