54 #include <rtems/test.h> 101 RtemsReqIdentLocal_Instance;
103 static const char *
const RtemsReqIdentLocal_PreDesc_Name[] = {
109 static const char *
const RtemsReqIdentLocal_PreDesc_Id[] = {
115 static const char *
const *
const RtemsReqIdentLocal_PreDesc[] = {
116 RtemsReqIdentLocal_PreDesc_Name,
117 RtemsReqIdentLocal_PreDesc_Id,
121 static void RtemsReqIdentLocal_Pre_Name_Prepare(
123 RtemsReqIdentLocal_Pre_Name state
127 case RtemsReqIdentLocal_Pre_Name_Invalid: {
132 case RtemsReqIdentLocal_Pre_Name_Valid: {
133 ctx->name = ClassicObjectLocalIdentName;
137 case RtemsReqIdentLocal_Pre_Name_NA:
142 static void RtemsReqIdentLocal_Pre_Id_Prepare(
144 RtemsReqIdentLocal_Pre_Id state
148 case RtemsReqIdentLocal_Pre_Id_NullPtr: {
153 case RtemsReqIdentLocal_Pre_Id_Valid: {
154 ctx->id_value = 0xffffffff;
155 ctx->id = &ctx->id_value;
159 case RtemsReqIdentLocal_Pre_Id_NA:
164 static void RtemsReqIdentLocal_Post_Status_Check(
166 RtemsReqIdentLocal_Post_Status state
170 case RtemsReqIdentLocal_Post_Status_Ok: {
175 case RtemsReqIdentLocal_Post_Status_InvAddr: {
180 case RtemsReqIdentLocal_Post_Status_InvName: {
185 case RtemsReqIdentLocal_Post_Status_NA:
190 static void RtemsReqIdentLocal_Post_Id_Check(
192 RtemsReqIdentLocal_Post_Id state
196 case RtemsReqIdentLocal_Post_Id_Nop: {
197 T_eq_ptr( ctx->id, &ctx->id_value );
198 T_eq_u32( ctx->id_value, 0xffffffff );
202 case RtemsReqIdentLocal_Post_Id_NullPtr: {
207 case RtemsReqIdentLocal_Post_Id_Id: {
208 T_eq_ptr( ctx->id, &ctx->id_value );
213 case RtemsReqIdentLocal_Post_Id_NA:
218 static size_t RtemsReqIdentLocal_Scope(
void *arg,
char *buf,
size_t n )
225 return T_get_scope( RtemsReqIdentLocal_PreDesc, buf, n, ctx->
pcs );
231 static T_fixture RtemsReqIdentLocal_Fixture = {
235 .scope = RtemsReqIdentLocal_Scope,
236 .initial_context = &RtemsReqIdentLocal_Instance
239 static const uint8_t RtemsReqIdentLocal_TransitionMap[][ 2 ] = {
241 RtemsReqIdentLocal_Post_Status_InvAddr,
242 RtemsReqIdentLocal_Post_Id_NullPtr
244 RtemsReqIdentLocal_Post_Status_InvName,
245 RtemsReqIdentLocal_Post_Id_Nop
247 RtemsReqIdentLocal_Post_Status_InvAddr,
248 RtemsReqIdentLocal_Post_Id_NullPtr
250 RtemsReqIdentLocal_Post_Status_Ok,
251 RtemsReqIdentLocal_Post_Id_Id
255 static const struct {
257 uint8_t Pre_Name_NA : 1;
258 uint8_t Pre_Id_NA : 1;
259 } RtemsReqIdentLocal_TransitionInfo[] = {
273 ctx->status = ( *ctx->
action )( ctx->name, ctx->id );
286 ctx = T_push_fixture( &RtemsReqIdentLocal_Node, &RtemsReqIdentLocal_Fixture );
294 ctx->
pcs[ 0 ] = RtemsReqIdentLocal_Pre_Name_Invalid;
295 ctx->
pcs[ 0 ] < RtemsReqIdentLocal_Pre_Name_NA;
298 if ( RtemsReqIdentLocal_TransitionInfo[ index ].Pre_Name_NA ) {
299 ctx->
pcs[ 0 ] = RtemsReqIdentLocal_Pre_Name_NA;
300 index += ( RtemsReqIdentLocal_Pre_Name_NA - 1 )
301 * RtemsReqIdentLocal_Pre_Id_NA;
305 ctx->
pcs[ 1 ] = RtemsReqIdentLocal_Pre_Id_NullPtr;
306 ctx->
pcs[ 1 ] < RtemsReqIdentLocal_Pre_Id_NA;
309 if ( RtemsReqIdentLocal_TransitionInfo[ index ].Pre_Id_NA ) {
310 ctx->
pcs[ 1 ] = RtemsReqIdentLocal_Pre_Id_NA;
311 index += ( RtemsReqIdentLocal_Pre_Id_NA - 1 );
314 if ( RtemsReqIdentLocal_TransitionInfo[ index ].Skip ) {
319 RtemsReqIdentLocal_Pre_Name_Prepare( ctx, ctx->
pcs[ 0 ] );
320 RtemsReqIdentLocal_Pre_Id_Prepare( ctx, ctx->
pcs[ 1 ] );
321 RtemsReqIdentLocal_Action( ctx );
322 RtemsReqIdentLocal_Post_Status_Check(
324 RtemsReqIdentLocal_TransitionMap[ index ][ 0 ]
326 RtemsReqIdentLocal_Post_Id_Check(
328 RtemsReqIdentLocal_TransitionMap[ index ][ 1 ]
Test context for spec:/rtems/req/ident-local test case.
rtems_status_code(* action)(rtems_name, rtems_id *)
This member contains a copy of the corresponding RtemsReqIdentLocal_Run() parameter.
uint32_t rtems_name
This type is used to represent a Classic API object name.
size_t pcs[2]
This member defines the pre-condition states for the next action.
void RtemsReqIdentLocal_Run(rtems_id id_local_object, rtems_status_code(*action)(rtems_name, rtems_id *))
Runs the parameterized test case.
This status code indicates successful completion.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
bool in_action_loop
This member indicates if the test action loop is currently executed.
rtems_id id_local_object
This member contains a copy of the corresponding RtemsReqIdentLocal_Run() parameter.
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.