diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-05-03 10:49:34 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-05-03 10:49:34 +0000 |
commit | 2713bd19c5ba6d454f0dafe2df8ab310a62536ef (patch) | |
tree | 85a7c46208e2f6e5ea2847f22235399a674125ba /test/testdyn.c | |
parent | 1f7dd2586a16b6f47ba6214faf954481de6c4086 (diff) | |
download | ChibiOS-2713bd19c5ba6d454f0dafe2df8ab310a62536ef.tar.gz ChibiOS-2713bd19c5ba6d454f0dafe2df8ab310a62536ef.tar.bz2 ChibiOS-2713bd19c5ba6d454f0dafe2df8ab310a62536ef.zip |
Small fix to the test suite.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@943 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/testdyn.c')
-rw-r--r-- | test/testdyn.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) &&
|