git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9232 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
Giovanni Di Sirio 2016-04-03 10:18:35 +00:00
parent 05b9eb5530
commit 8b133b8c18
4 changed files with 34 additions and 10 deletions

View File

@ -2202,7 +2202,7 @@ test_assert_sequence("ABCDE", "invalid sequence");]]></value>
<value>This test case verifies the priority boost of a thread waiting on a conditional variable queue. It tests this very specific situation in order to improve code coverage. The created threads perform the following operations: TA{lock(M2), lock(M1), wait(C1), unlock(M1), unlock(M2)}, TB{lock(M2), wait(C1), unlock(M2)}. TC{lock(M1), unlock(M1)}.</value>
</description>
<condition>
<value />
<value>CH_CFG_USE_CONDVARS</value>
</condition>
<various_code>
<setup_code>
@ -2792,7 +2792,7 @@ test_wait_threads();]]></value>
<value>Timeout functionality is tested for chEvtWaitOneTimeout(), chEvtWaitAnyTimeout() and chEvtWaitAllTimeout().</value>
</description>
<condition>
<value />
<value>CH_CFG_USE_EVENTS_TIMEOUT</value>
</condition>
<various_code>
<setup_code>
@ -3308,11 +3308,11 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
<value><![CDATA[#define MEMORY_POOL_SIZE 4
static uint32_t objects[MEMORY_POOL_SIZE];
static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
#if CH_CFG_USE_SEMAPHORES
#if CH_CFG_USE_SEMAPHORES
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
#endif
#endif
static void *null_provider(size_t size, unsigned align) {
@ -4139,12 +4139,14 @@ static THD_FUNCTION(bmk_thread4, p) {
chSysUnlock();
}
#if CH_CFG_USE_SEMAPHORES
static THD_FUNCTION(bmk_thread7, p) {
(void)p;
while (!chThdShouldTerminateX())
chSemWait(&sem1);
}
#endif
static THD_FUNCTION(bmk_thread8, p) {
@ -4548,12 +4550,12 @@ systime_t start, end;]]></value>
<value><![CDATA[n = 0;
start = test_wait_tick();
end = start + MS2ST(1000);
do {
do {
#if CH_CFG_USE_REGISTRY
chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
#else
chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL);
#endif
chThdRelease(chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL));
#else
chThdCreateStatic(wa[0], WA_SIZE, prio, bmk_thread3, NULL);
#endif
n++;
#if defined(SIMULATOR)
_sim_check_for_interrupts();

View File

@ -932,6 +932,7 @@ static const testcase_t test_005_008 = {
};
#endif /* CH_CFG_USE_CONDVARS */
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
/**
* @page test_005_009 [5.9] Condition Variable priority boost test
*
@ -943,6 +944,12 @@ static const testcase_t test_005_008 = {
* unlock(M2)}, TB{lock(M2), wait(C1), unlock(M2)}. TC{lock(M1),
* unlock(M1)}.
*
* <h2>Conditions</h2>
* This test is only executed if the following preprocessor condition
* evaluates to true:
* - CH_CFG_USE_CONDVARS
* .
*
* <h2>Test Steps</h2>
* - [5.9.1] Reading current base priority.
* - [5.9.2] Thread A is created at priority P(+1), it locks M2, locks
@ -1023,6 +1030,7 @@ static const testcase_t test_005_009 = {
NULL,
test_005_009_execute
};
#endif /* CH_CFG_USE_CONDVARS */
/****************************************************************************
* Exported data.
@ -1052,7 +1060,9 @@ const testcase_t * const test_sequence_005[] = {
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
&test_005_008,
#endif
#if (CH_CFG_USE_CONDVARS) || defined(__DOXYGEN__)
&test_005_009,
#endif
NULL
};

View File

@ -406,6 +406,7 @@ static const testcase_t test_007_005 = {
test_007_005_execute
};
#if (CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
/**
* @page test_007_006 [7.6] Events Flags wait timeouts
*
@ -413,6 +414,12 @@ static const testcase_t test_007_005 = {
* Timeout functionality is tested for chEvtWaitOneTimeout(),
* chEvtWaitAnyTimeout() and chEvtWaitAllTimeout().
*
* <h2>Conditions</h2>
* This test is only executed if the following preprocessor condition
* evaluates to true:
* - CH_CFG_USE_EVENTS_TIMEOUT
* .
*
* <h2>Test Steps</h2>
* - [7.6.1] The functions are invoked first with TIME_IMMEDIATE
* timeout, the timeout condition is tested.
@ -459,6 +466,7 @@ static const testcase_t test_007_006 = {
NULL,
test_007_006_execute
};
#endif /* CH_CFG_USE_EVENTS_TIMEOUT */
/**
* @page test_007_007 [7.7] Broadcasting using chEvtBroadcast()
@ -551,7 +559,9 @@ const testcase_t * const test_sequence_007[] = {
&test_007_003,
&test_007_004,
&test_007_005,
#if (CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
&test_007_006,
#endif
&test_007_007,
NULL
};

View File

@ -112,12 +112,14 @@ static THD_FUNCTION(bmk_thread4, p) {
chSysUnlock();
}
#if CH_CFG_USE_SEMAPHORES
static THD_FUNCTION(bmk_thread7, p) {
(void)p;
while (!chThdShouldTerminateX())
chSemWait(&sem1);
}
#endif
static THD_FUNCTION(bmk_thread8, p) {