Fixed bug #692.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8763 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
b2b371f231
commit
c2ffa54ce1
|
@ -76,6 +76,8 @@
|
||||||
- RT: Removed the p_msg field from the thread_t structure saving a
|
- RT: Removed the p_msg field from the thread_t structure saving a
|
||||||
msg_t-sized field from the structure. Messages now use a new field
|
msg_t-sized field from the structure. Messages now use a new field
|
||||||
into the p_u union. Now synchronous messages are even faster.
|
into the p_u union. Now synchronous messages are even faster.
|
||||||
|
- NIL: Fixed NIL test suite calls I and S functions outside critical zone
|
||||||
|
(bug #692)(backported to 3.0.5 and 16.1.1).
|
||||||
- NIL: Fixed protocol violation in NIL OSAL (bug #691)(backported to
|
- NIL: Fixed protocol violation in NIL OSAL (bug #691)(backported to
|
||||||
3.0.5 and 16.1.1).
|
3.0.5 and 16.1.1).
|
||||||
- HAL: Fixed error in HAL buffer queues (bug #689)(backported to 16.1.1).
|
- HAL: Fixed error in HAL buffer queues (bug #689)(backported to 16.1.1).
|
||||||
|
|
|
@ -51,7 +51,11 @@ thread_reference_t gtr1;
|
||||||
*/
|
*/
|
||||||
THD_WORKING_AREA(wa_test_support, 128);
|
THD_WORKING_AREA(wa_test_support, 128);
|
||||||
THD_FUNCTION(test_support, arg) {
|
THD_FUNCTION(test_support, arg) {
|
||||||
|
#if NIL_CFG_USE_EVENTS == TRUE
|
||||||
thread_t *tp = (thread_t *)arg;
|
thread_t *tp = (thread_t *)arg;
|
||||||
|
#else
|
||||||
|
(void)arg;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initializing global resources.*/
|
/* Initializing global resources.*/
|
||||||
chSemObjectInit(&gsem1, 0);
|
chSemObjectInit(&gsem1, 0);
|
||||||
|
@ -64,7 +68,9 @@ THD_FUNCTION(test_support, arg) {
|
||||||
chSemSignalI(&gsem1);
|
chSemSignalI(&gsem1);
|
||||||
chSemResetI(&gsem2, 0);
|
chSemResetI(&gsem2, 0);
|
||||||
chThdResumeI(>r1, MSG_OK);
|
chThdResumeI(>r1, MSG_OK);
|
||||||
|
#if NIL_CFG_USE_EVENTS == TRUE
|
||||||
chEvtSignalI(tp, 0x55);
|
chEvtSignalI(tp, 0x55);
|
||||||
|
#endif
|
||||||
chSchRescheduleS();
|
chSchRescheduleS();
|
||||||
chSysUnlock();
|
chSysUnlock();
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,9 @@ static void test_002_004_execute(void) {
|
||||||
and the state of the reference are tested.*/
|
and the state of the reference are tested.*/
|
||||||
test_set_step(1);
|
test_set_step(1);
|
||||||
{
|
{
|
||||||
|
chSysLock();
|
||||||
msg = chThdSuspendTimeoutS(>r1, TIME_INFINITE);
|
msg = chThdSuspendTimeoutS(>r1, TIME_INFINITE);
|
||||||
|
chSysUnlock();
|
||||||
test_assert(NULL == gtr1,
|
test_assert(NULL == gtr1,
|
||||||
"not NULL");
|
"not NULL");
|
||||||
test_assert(MSG_OK == msg,
|
test_assert(MSG_OK == msg,
|
||||||
|
@ -303,8 +305,10 @@ static void test_002_004_execute(void) {
|
||||||
and the state of the reference are tested.*/
|
and the state of the reference are tested.*/
|
||||||
test_set_step(2);
|
test_set_step(2);
|
||||||
{
|
{
|
||||||
|
chSysLock();
|
||||||
time = chVTGetSystemTimeX();
|
time = chVTGetSystemTimeX();
|
||||||
msg = chThdSuspendTimeoutS(&tr1, MS2ST(1000));
|
msg = chThdSuspendTimeoutS(&tr1, MS2ST(1000));
|
||||||
|
chSysUnlock();
|
||||||
test_assert_time_window(time + MS2ST(1000),
|
test_assert_time_window(time + MS2ST(1000),
|
||||||
time + MS2ST(1000) + 1,
|
time + MS2ST(1000) + 1,
|
||||||
"out of time window");
|
"out of time window");
|
||||||
|
@ -323,7 +327,7 @@ static const testcase_t test_002_004 = {
|
||||||
};
|
};
|
||||||
#endif /* TRUE */
|
#endif /* TRUE */
|
||||||
|
|
||||||
#if TRUE || defined(__DOXYGEN__)
|
#if (NIL_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @page test_002_005 Events functionality
|
* @page test_002_005 Events functionality
|
||||||
*
|
*
|
||||||
|
@ -362,7 +366,7 @@ static void test_002_005_execute(void) {
|
||||||
test_set_step(1);
|
test_set_step(1);
|
||||||
{
|
{
|
||||||
time = chVTGetSystemTimeX();
|
time = chVTGetSystemTimeX();
|
||||||
chEvtSignalI(chThdGetSelfX(), 0x55);
|
chEvtSignal(chThdGetSelfX(), 0x55);
|
||||||
events = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000));
|
events = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000));
|
||||||
test_assert((eventmask_t)0 != events,
|
test_assert((eventmask_t)0 != events,
|
||||||
"timed out");
|
"timed out");
|
||||||
|
@ -388,10 +392,8 @@ static void test_002_005_execute(void) {
|
||||||
wakeup the thread, the function must return because timeout.*/
|
wakeup the thread, the function must return because timeout.*/
|
||||||
test_set_step(3);
|
test_set_step(3);
|
||||||
{
|
{
|
||||||
chSysLock();
|
|
||||||
time = chVTGetSystemTimeX();
|
time = chVTGetSystemTimeX();
|
||||||
events = chEvtWaitAnyTimeoutS(0, MS2ST(1000));
|
events = chEvtWaitAnyTimeout(0, MS2ST(1000));
|
||||||
chSysUnlock();
|
|
||||||
test_assert_time_window(time + MS2ST(1000),
|
test_assert_time_window(time + MS2ST(1000),
|
||||||
time + MS2ST(1000) + 1,
|
time + MS2ST(1000) + 1,
|
||||||
"out of time window");
|
"out of time window");
|
||||||
|
@ -406,7 +408,7 @@ static const testcase_t test_002_005 = {
|
||||||
NULL,
|
NULL,
|
||||||
test_002_005_execute
|
test_002_005_execute
|
||||||
};
|
};
|
||||||
#endif /* TRUE */
|
#endif /* NIL_CFG_USE_EVENTS == TRUE */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Exported data.
|
* Exported data.
|
||||||
|
@ -428,7 +430,7 @@ const testcase_t * const test_sequence_002[] = {
|
||||||
#if TRUE || defined(__DOXYGEN__)
|
#if TRUE || defined(__DOXYGEN__)
|
||||||
&test_002_004,
|
&test_002_004,
|
||||||
#endif
|
#endif
|
||||||
#if TRUE || defined(__DOXYGEN__)
|
#if (NIL_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
|
||||||
&test_002_005,
|
&test_002_005,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
|
|
Loading…
Reference in New Issue