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 19
19
#include " unity/unity.h"
20
20
21
21
22
- #if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER || !defined(MBED_CONF_RTOS_PRESENT)
22
+ #if !DEVICE_USTICKER
23
23
#error [NOT_SUPPORTED] test not supported
24
24
#else
25
25
26
26
using utest::v1::Case;
27
27
28
28
extern uint32_t mbed_heap_size;
29
29
static const int test_timeout = 25 ;
30
+ #if defined(MBED_CONF_RTOS_PRESENT)
30
31
volatile bool thread_should_continue = true ;
31
32
#define NUM_THREADS 4
32
33
#define THREAD_MALLOC_SIZE 100
@@ -59,7 +60,7 @@ void task_using_malloc(void)
59
60
free (data);
60
61
}
61
62
}
62
-
63
+ # endif
63
64
/* * Test for multithreaded heap allocations
64
65
65
66
Given multiple threads are started in parallel
@@ -68,6 +69,7 @@ void task_using_malloc(void)
68
69
*/
69
70
void test_multithread_allocation (void )
70
71
{
72
+ #if defined(MBED_CONF_RTOS_PRESENT)
71
73
// static stack for threads to reduce heap usage on devices with small RAM
72
74
// and eliminate run out of heap memory problem
73
75
uint8_t stack[NUM_THREADS][THREAD_STACK_SIZE];
@@ -101,6 +103,7 @@ void test_multithread_allocation(void)
101
103
}
102
104
}
103
105
TEST_ASSERT_FALSE (thread_alloc_failure);
106
+ #endif
104
107
}
105
108
106
109
/* * Test for multiple heap alloc and free calls */
You can’t perform that action at this time.
0 commit comments