git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@901 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
339c8e993d
commit
1f5d676018
|
@ -46,6 +46,8 @@ static void dyn1_execute(void) {
|
||||||
prio-1, thread, "A");
|
prio-1, thread, "A");
|
||||||
threads[1] = chThdCreateFromHeap(THD_WA_SIZE(THREADS_STACK_SIZE),
|
threads[1] = chThdCreateFromHeap(THD_WA_SIZE(THREADS_STACK_SIZE),
|
||||||
prio-2, thread, "B");
|
prio-2, thread, "B");
|
||||||
|
threads[2] = chThdCreateFromHeap(THD_WA_SIZE(0x10000000),
|
||||||
|
prio-3, thread, "C");
|
||||||
|
|
||||||
test_assert((threads[0] != NULL) &&
|
test_assert((threads[0] != NULL) &&
|
||||||
(threads[1] != NULL) &&
|
(threads[1] != NULL) &&
|
||||||
|
@ -90,7 +92,7 @@ static void dyn2_execute(void) {
|
||||||
tprio_t prio = chThdGetPriority();
|
tprio_t prio = chThdGetPriority();
|
||||||
|
|
||||||
/* Adding the WAs to the pool. */
|
/* Adding the WAs to the pool. */
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 4; i++)
|
||||||
chPoolFree(&mp1, wa[i]);
|
chPoolFree(&mp1, wa[i]);
|
||||||
|
|
||||||
/* Starting threads from the memory pool. */
|
/* Starting threads from the memory pool. */
|
||||||
|
@ -104,15 +106,15 @@ static void dyn2_execute(void) {
|
||||||
(threads[1] != NULL) &&
|
(threads[1] != NULL) &&
|
||||||
(threads[2] != NULL) &&
|
(threads[2] != NULL) &&
|
||||||
(threads[3] != NULL) &&
|
(threads[3] != NULL) &&
|
||||||
(threads[4] != NULL),
|
(threads[4] == NULL),
|
||||||
"#1"); /* Thread creation failed.*/
|
"#1"); /* Thread creation failed.*/
|
||||||
|
|
||||||
/* Claiming the memory from terminated threads. */
|
/* Claiming the memory from terminated threads. */
|
||||||
test_wait_threads();
|
test_wait_threads();
|
||||||
test_assert_sequence("ABCDE");
|
test_assert_sequence("ABCD");
|
||||||
|
|
||||||
/* Now the pool must be full again. */
|
/* Now the pool must be full again. */
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 4; i++)
|
||||||
test_assert(chPoolAlloc(&mp1) != NULL, "#2"); /* Pool list empty.*/
|
test_assert(chPoolAlloc(&mp1) != NULL, "#2"); /* Pool list empty.*/
|
||||||
test_assert(chPoolAlloc(&mp1) == NULL, "#3"); /* Pool list not empty.*/
|
test_assert(chPoolAlloc(&mp1) == NULL, "#3"); /* Pool list not empty.*/
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue