diff options
Diffstat (limited to 'testsuites/validation/tr-model-events-mgr-2.c')
-rw-r--r-- | testsuites/validation/tr-model-events-mgr-2.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/testsuites/validation/tr-model-events-mgr-2.c b/testsuites/validation/tr-model-events-mgr-2.c index eeeabb32c5..3dbc65befb 100644 --- a/testsuites/validation/tr-model-events-mgr-2.c +++ b/testsuites/validation/tr-model-events-mgr-2.c @@ -41,7 +41,7 @@ * for information how to maintain and re-generate this file. */ -#ifdef HAVE_CONFIG_H +#ifndef HAVE_CONFIG_H #include "config.h" #endif @@ -50,7 +50,7 @@ #include "tr-model-events-mgr.h" -/* =============================================== */ +// =============================================== // @@@ 0 NAME Event_Manager_TestGen // @@@ 0 DEF NO_OF_EVENTS 4 @@ -96,7 +96,7 @@ static rtems_event_set recout = 0; // @@@ 0 DCLARRAY Semaphore semaphore SEMA_MAX static rtems_id semaphore[SEMA_MAX]; -/* ===== TEST CODE SEGMENT 0 =====*/ +// ===== TEST CODE SEGMENT 0 ===== static void TestSegment0( Context* ctx ) { /* Test Name is defined in the Test Case code (tc-model-events-mgr.c) */ @@ -107,7 +107,14 @@ static void TestSegment0( Context* ctx ) { } -/* ===== TEST CODE SEGMENT 3 =====*/ +// ===== TEST CODE SEGMENT 2 ===== + +static void TestSegment2( Context* ctx ) { + T_log(T_NORMAL,"@@@ 2 STATE 1 Ready"); + /* We (Task 1) can't check we are ready because we are running */ +} + +// ===== TEST CODE SEGMENT 3 ===== static void TestSegment3( Context* ctx ) { T_log(T_NORMAL,"@@@ 3 TASK Worker"); @@ -115,13 +122,6 @@ static void TestSegment3( Context* ctx ) { T_log(T_NORMAL,"@@@ 3 WAIT 0"); Wait( semaphore[0] ); - T_log(T_NORMAL,"@@@ 3 CALL event_send 0 1 14 sendrc"); - T_log( T_NORMAL, "Calling Send(%d,%d)", mapid( ctx, 1), 14 ); - sendrc = ( *ctx->send )( mapid( ctx, 1 ), 14 ); - T_log( T_NORMAL, "Returned 0x%x from Send", sendrc ); - - T_log(T_NORMAL,"@@@ 3 SCALAR sendrc 0"); - T_rsc( sendrc, 0 ); T_log(T_NORMAL,"@@@ 3 SIGNAL 1"); Wakeup( semaphore[1] ); @@ -129,7 +129,7 @@ static void TestSegment3( Context* ctx ) { /* Code to check that Task 0 has terminated */ } -/* ===== TEST CODE SEGMENT 4 =====*/ +// ===== TEST CODE SEGMENT 4 ===== static void TestSegment4( Context* ctx ) { T_log(T_NORMAL,"@@@ 4 TASK Runner"); @@ -140,22 +140,26 @@ static void TestSegment4( Context* ctx ) { T_log(T_NORMAL,"@@@ 4 WAIT 1"); Wait( semaphore[1] ); - T_log(T_NORMAL,"@@@ 4 SCALAR pending 1 14"); + T_log(T_NORMAL,"@@@ 4 SCALAR pending 1 0"); pending[1] = GetPending( ctx ); - T_eq_int( pending[1], 14 ); + T_eq_int( pending[1], 0 ); - T_log(T_NORMAL,"@@@ 4 CALL event_receive 10 1 1 0 recout recrc"); - T_log( T_NORMAL, "Calling Receive(%d,%d,%d,%d)", 10, mergeopts( 1, 1 ) ,0 ,&recout ); - recrc = ( *ctx->receive )( 10, mergeopts( 1, 1 ), 0, &recout ); + T_log(T_NORMAL,"@@@ 4 CALL event_receive 10 1 1 4 recout recrc"); + T_log( T_NORMAL, "Calling Receive(%d,%d,%d,%d)", 10, mergeopts( 1, 1 ) ,4 ,&recout ); + recrc = ( *ctx->receive )( 10, mergeopts( 1, 1 ), 4, &recout ); T_log( T_NORMAL, "Returned 0x%x from Receive", recrc ); - T_log(T_NORMAL,"@@@ 4 SCALAR recrc 0"); - T_rsc( recrc, 0 ); - T_log(T_NORMAL,"@@@ 4 SCALAR recout 10"); - T_eq_int( recout, 10 ); - T_log(T_NORMAL,"@@@ 4 SCALAR pending 1 4"); + T_log(T_NORMAL,"@@@ 4 STATE 1 TimeWait 4"); + // DON'T KNOW HOW TO REFINE: 4 'STATE + T_log(T_NORMAL,"@@@ 4 STATE 1 Ready"); + /* We (Task 1) can't check we are ready because we are running */ + T_log(T_NORMAL,"@@@ 4 SCALAR recrc 6"); + T_rsc( recrc, 6 ); + T_log(T_NORMAL,"@@@ 4 SCALAR recout 0"); + T_eq_int( recout, 0 ); + T_log(T_NORMAL,"@@@ 4 SCALAR pending 1 0"); pending[1] = GetPending( ctx ); - T_eq_int( pending[1], 4 ); + T_eq_int( pending[1], 0 ); T_log(T_NORMAL,"@@@ 4 SIGNAL 0"); Wakeup( semaphore[0] ); @@ -164,7 +168,7 @@ static void TestSegment4( Context* ctx ) { /* Code to check that Task 1 has terminated */ } -/* =============================================== */ +// =============================================== |