Skip to content

Commit 9297192

Browse files
committed
Enabled supported test cases of "malloc" for Bare-Metal.
1 parent a0dbe35 commit 9297192

File tree

1 file changed

+5
-2
lines changed
  • TESTS/mbedmicro-rtos-mbed/malloc

1 file changed

+5
-2
lines changed

TESTS/mbedmicro-rtos-mbed/malloc/main.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
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

2626
using utest::v1::Case;
2727

2828
extern uint32_t mbed_heap_size;
2929
static const int test_timeout = 25;
30+
#if defined(MBED_CONF_RTOS_PRESENT)
3031
volatile 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
*/
6970
void 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 */

0 commit comments

Comments
 (0)