54 #include <rtems/test.h> 105 RtemsReqIdent_Instance;
107 static const char *
const RtemsReqIdent_PreDesc_Name[] = {
113 static const char *
const RtemsReqIdent_PreDesc_Node[] = {
123 static const char *
const RtemsReqIdent_PreDesc_Id[] = {
129 static const char *
const *
const RtemsReqIdent_PreDesc[] = {
130 RtemsReqIdent_PreDesc_Name,
131 RtemsReqIdent_PreDesc_Node,
132 RtemsReqIdent_PreDesc_Id,
136 static void RtemsReqIdent_Pre_Name_Prepare(
138 RtemsReqIdent_Pre_Name state
142 case RtemsReqIdent_Pre_Name_Invalid: {
147 case RtemsReqIdent_Pre_Name_Valid: {
148 ctx->name = ClassicObjectIdentName;
152 case RtemsReqIdent_Pre_Name_NA:
157 static void RtemsReqIdent_Pre_Node_Prepare(
159 RtemsReqIdent_Pre_Node state
163 case RtemsReqIdent_Pre_Node_Local: {
168 case RtemsReqIdent_Pre_Node_Remote: {
173 case RtemsReqIdent_Pre_Node_Invalid: {
178 case RtemsReqIdent_Pre_Node_SearchAll: {
183 case RtemsReqIdent_Pre_Node_SearchOther: {
188 case RtemsReqIdent_Pre_Node_SearchLocal: {
193 case RtemsReqIdent_Pre_Node_NA:
198 static void RtemsReqIdent_Pre_Id_Prepare(
200 RtemsReqIdent_Pre_Id state
204 case RtemsReqIdent_Pre_Id_NullPtr: {
209 case RtemsReqIdent_Pre_Id_Valid: {
210 ctx->id_value = 0xffffffff;
211 ctx->id = &ctx->id_value;
215 case RtemsReqIdent_Pre_Id_NA:
220 static void RtemsReqIdent_Post_Status_Check(
222 RtemsReqIdent_Post_Status state
226 case RtemsReqIdent_Post_Status_Ok: {
231 case RtemsReqIdent_Post_Status_InvAddr: {
236 case RtemsReqIdent_Post_Status_InvName: {
241 case RtemsReqIdent_Post_Status_InvNode: {
246 case RtemsReqIdent_Post_Status_NA:
251 static void RtemsReqIdent_Post_Id_Check(
253 RtemsReqIdent_Post_Id state
257 case RtemsReqIdent_Post_Id_Nop: {
258 T_eq_ptr(ctx->id, &ctx->id_value);
259 T_eq_u32(ctx->id_value, 0xffffffff);
263 case RtemsReqIdent_Post_Id_NullPtr: {
268 case RtemsReqIdent_Post_Id_LocalObj: {
269 T_eq_ptr(ctx->id, &ctx->id_value);
274 case RtemsReqIdent_Post_Id_RemoteObj: {
275 T_eq_ptr(ctx->id, &ctx->id_value);
276 T_eq_u32(ctx->id_value, ctx->id_remote_object);
280 case RtemsReqIdent_Post_Id_NA:
285 static size_t RtemsReqIdent_Scope(
void *arg,
char *buf,
size_t n )
292 return T_get_scope( RtemsReqIdent_PreDesc, buf, n, ctx->
pcs );
298 static T_fixture RtemsReqIdent_Fixture = {
302 .scope = RtemsReqIdent_Scope,
303 .initial_context = &RtemsReqIdent_Instance
306 static const uint8_t RtemsReqIdent_TransitionMap[][ 2 ] = {
308 RtemsReqIdent_Post_Status_InvAddr,
309 RtemsReqIdent_Post_Id_NullPtr
311 RtemsReqIdent_Post_Status_InvName,
312 RtemsReqIdent_Post_Id_Nop
314 RtemsReqIdent_Post_Status_InvAddr,
315 RtemsReqIdent_Post_Id_NullPtr
317 RtemsReqIdent_Post_Status_InvName,
318 RtemsReqIdent_Post_Id_Nop
320 RtemsReqIdent_Post_Status_InvAddr,
321 RtemsReqIdent_Post_Id_NullPtr
323 RtemsReqIdent_Post_Status_InvName,
324 RtemsReqIdent_Post_Id_Nop
326 RtemsReqIdent_Post_Status_InvAddr,
327 RtemsReqIdent_Post_Id_NullPtr
329 RtemsReqIdent_Post_Status_InvName,
330 RtemsReqIdent_Post_Id_Nop
332 RtemsReqIdent_Post_Status_InvAddr,
333 RtemsReqIdent_Post_Id_NullPtr
335 RtemsReqIdent_Post_Status_InvName,
336 RtemsReqIdent_Post_Id_Nop
338 RtemsReqIdent_Post_Status_InvAddr,
339 RtemsReqIdent_Post_Id_NullPtr
341 RtemsReqIdent_Post_Status_InvName,
342 RtemsReqIdent_Post_Id_Nop
344 RtemsReqIdent_Post_Status_InvAddr,
345 RtemsReqIdent_Post_Id_NullPtr
347 RtemsReqIdent_Post_Status_Ok,
348 RtemsReqIdent_Post_Id_LocalObj
350 RtemsReqIdent_Post_Status_InvAddr,
351 RtemsReqIdent_Post_Id_NullPtr
353 #if defined(RTEMS_MULTIPROCESSING) 354 RtemsReqIdent_Post_Status_Ok,
355 RtemsReqIdent_Post_Id_RemoteObj
357 RtemsReqIdent_Post_Status_InvName,
358 RtemsReqIdent_Post_Id_Nop
361 RtemsReqIdent_Post_Status_InvAddr,
362 RtemsReqIdent_Post_Id_NullPtr
364 RtemsReqIdent_Post_Status_InvName,
365 RtemsReqIdent_Post_Id_Nop
367 RtemsReqIdent_Post_Status_InvAddr,
368 RtemsReqIdent_Post_Id_NullPtr
370 RtemsReqIdent_Post_Status_Ok,
371 RtemsReqIdent_Post_Id_LocalObj
373 RtemsReqIdent_Post_Status_InvAddr,
374 RtemsReqIdent_Post_Id_NullPtr
376 #if defined(RTEMS_MULTIPROCESSING) 377 RtemsReqIdent_Post_Status_Ok,
378 RtemsReqIdent_Post_Id_RemoteObj
380 RtemsReqIdent_Post_Status_InvName,
381 RtemsReqIdent_Post_Id_Nop
384 RtemsReqIdent_Post_Status_InvAddr,
385 RtemsReqIdent_Post_Id_NullPtr
387 RtemsReqIdent_Post_Status_Ok,
388 RtemsReqIdent_Post_Id_LocalObj
392 static const struct {
394 uint8_t Pre_Name_NA : 1;
395 uint8_t Pre_Node_NA : 1;
396 uint8_t Pre_Id_NA : 1;
397 } RtemsReqIdent_TransitionInfo[] = {
429 #if defined(RTEMS_MULTIPROCESSING) 445 #if defined(RTEMS_MULTIPROCESSING) 459 ctx->status = ( *ctx->
action )( ctx->name, ctx->node, ctx->id );
472 ctx = T_push_fixture( &RtemsReqIdent_Node, &RtemsReqIdent_Fixture );
480 ctx->
pcs[ 0 ] = RtemsReqIdent_Pre_Name_Invalid;
481 ctx->
pcs[ 0 ] < RtemsReqIdent_Pre_Name_NA;
484 if ( RtemsReqIdent_TransitionInfo[ index ].Pre_Name_NA ) {
485 ctx->
pcs[ 0 ] = RtemsReqIdent_Pre_Name_NA;
486 index += ( RtemsReqIdent_Pre_Name_NA - 1 )
487 * RtemsReqIdent_Pre_Node_NA
488 * RtemsReqIdent_Pre_Id_NA;
492 ctx->
pcs[ 1 ] = RtemsReqIdent_Pre_Node_Local;
493 ctx->
pcs[ 1 ] < RtemsReqIdent_Pre_Node_NA;
496 if ( RtemsReqIdent_TransitionInfo[ index ].Pre_Node_NA ) {
497 ctx->
pcs[ 1 ] = RtemsReqIdent_Pre_Node_NA;
498 index += ( RtemsReqIdent_Pre_Node_NA - 1 )
499 * RtemsReqIdent_Pre_Id_NA;
503 ctx->
pcs[ 2 ] = RtemsReqIdent_Pre_Id_NullPtr;
504 ctx->
pcs[ 2 ] < RtemsReqIdent_Pre_Id_NA;
507 if ( RtemsReqIdent_TransitionInfo[ index ].Pre_Id_NA ) {
508 ctx->
pcs[ 2 ] = RtemsReqIdent_Pre_Id_NA;
509 index += ( RtemsReqIdent_Pre_Id_NA - 1 );
512 if ( RtemsReqIdent_TransitionInfo[ index ].Skip ) {
517 RtemsReqIdent_Pre_Name_Prepare( ctx, ctx->
pcs[ 0 ] );
518 RtemsReqIdent_Pre_Node_Prepare( ctx, ctx->
pcs[ 1 ] );
519 RtemsReqIdent_Pre_Id_Prepare( ctx, ctx->
pcs[ 2 ] );
520 RtemsReqIdent_Action( ctx );
521 RtemsReqIdent_Post_Status_Check(
523 RtemsReqIdent_TransitionMap[ index ][ 0 ]
525 RtemsReqIdent_Post_Id_Check(
527 RtemsReqIdent_TransitionMap[ index ][ 1 ]
bool in_action_loop
This member indicates if the test action loop is currently executed.
rtems_status_code(* action)(rtems_name, uint32_t, rtems_id *)
This member contains a copy of the corresponding RtemsReqIdent_Run() parameter.
uint32_t rtems_name
This type is used to represent a Classic API object name.
size_t pcs[3]
This member defines the pre-condition states for the next action.
rtems_id id_local_object
This member contains a copy of the corresponding RtemsReqIdent_Run() parameter.
#define RTEMS_SEARCH_ALL_NODES
%
This status code indicates successful completion.
void RtemsReqIdent_Run(rtems_id id_local_object, rtems_status_code(*action)(rtems_name, uint32_t, rtems_id *))
Runs the parameterized test case.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
#define RTEMS_SEARCH_OTHER_NODES
%
This status code indicates that a specified node identifier was invalid.
This status code indicates that a specified address was invalid.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
This status code indicates that an object name was invalid.
#define RTEMS_SEARCH_LOCAL_NODE
%
Test context for spec:/rtems/req/ident test case.