From 2713bd19c5ba6d454f0dafe2df8ab310a62536ef Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 3 May 2009 10:49:34 +0000 Subject: [PATCH] Small fix to the test suite. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@943 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/testdyn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testdyn.c b/test/testdyn.c index d42cbf17e..bd32064e1 100644 --- a/test/testdyn.c +++ b/test/testdyn.c @@ -37,6 +37,7 @@ static char *dyn1_gettest(void) { static void dyn1_execute(void) { size_t n, sz; + void *p1; tprio_t prio = chThdGetPriority(); /* Test skipped if the heap is already fragmented. */ @@ -46,8 +47,12 @@ static void dyn1_execute(void) { prio-1, thread, "A"); threads[1] = chThdCreateFromHeap(THD_WA_SIZE(THREADS_STACK_SIZE), prio-2, thread, "B"); - threads[2] = chThdCreateFromHeap(THD_WA_SIZE(0x10000000), + /* Allocating the whole heap in order to make the thread creation fail.*/ + (void)chHeapStatus(&n); + p1 = chHeapAlloc(n); + threads[2] = chThdCreateFromHeap(THD_WA_SIZE(THREADS_STACK_SIZE), prio-3, thread, "C"); + chHeapFree(p1); test_assert(1, (threads[0] != NULL) && (threads[1] != NULL) &&