File indexing completed on 2025-05-11 08:24:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifdef HAVE_CONFIG_H
0030 #include "config.h"
0031 #endif
0032
0033 #define CONFIGURE_INIT
0034 #include "system.h"
0035
0036 const char rtems_test_name[] = "SP PORT ERROR 01";
0037
0038 rtems_task Init(
0039 rtems_task_argument argument
0040 )
0041 {
0042 void *converted;
0043 rtems_status_code status;
0044
0045 TEST_BEGIN();
0046 Port_name[ 1 ] = rtems_build_name( 'D', 'P', '1', ' ' );
0047 status = rtems_port_create(
0048 0,
0049 Internal_port_area,
0050 External_port_area,
0051 sizeof( Internal_port_area ),
0052 &Junk_id
0053 );
0054 fatal_directive_status(
0055 status,
0056 RTEMS_INVALID_NAME,
0057 "rtems_port_create with illegal name"
0058 );
0059 puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
0060
0061 #if defined(_C3x) || defined(_C4x)
0062 puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS - SKIPPED" );
0063 #else
0064 status = rtems_port_create(
0065 Port_name[ 1 ],
0066 &((char *)Internal_port_area)[ 1 ],
0067 External_port_area,
0068 sizeof( Internal_port_area ),
0069 &Junk_id
0070 );
0071 fatal_directive_status(
0072 status,
0073 RTEMS_INVALID_ADDRESS,
0074 "rtems_port_create with illegal address"
0075 );
0076 puts( "TA1 - rtems_port_create - bad range - RTEMS_INVALID_ADDRESS" );
0077 #endif
0078
0079 status = rtems_port_create(
0080 Port_name[ 1 ],
0081 Internal_port_area,
0082 External_port_area,
0083 sizeof( Internal_port_area ),
0084 NULL
0085 );
0086 fatal_directive_status(
0087 status,
0088 RTEMS_INVALID_ADDRESS,
0089 "rtems_port_create null Id"
0090 );
0091 puts( "TA1 - rtems_port_create - null id - RTEMS_INVALID_ADDRESS" );
0092
0093 status = rtems_port_create(
0094 Port_name[ 1 ],
0095 Internal_port_area,
0096 External_port_area,
0097 sizeof( Internal_port_area ),
0098 &Junk_id
0099 );
0100 fatal_directive_status(
0101 status,
0102 RTEMS_TOO_MANY,
0103 "rtems_port_create of too many"
0104 );
0105 puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
0106
0107 status = rtems_port_delete( 0 );
0108 fatal_directive_status(
0109 status,
0110 RTEMS_INVALID_ID,
0111 "rtems_port_delete with illegal id"
0112 );
0113 puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
0114
0115 status = rtems_port_ident( 0, &Junk_id );
0116 fatal_directive_status(
0117 status,
0118 RTEMS_INVALID_NAME,
0119 "rtems_port_ident with illegal name"
0120 );
0121 puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
0122
0123 status = rtems_port_external_to_internal(
0124 100,
0125 Internal_port_area,
0126 &converted
0127 );
0128 fatal_directive_status(
0129 status,
0130 RTEMS_INVALID_ID,
0131 "rtems_port_external_to_internal with illegal id"
0132 );
0133
0134 status = rtems_port_external_to_internal(
0135 100,
0136 Internal_port_area,
0137 NULL
0138 );
0139 fatal_directive_status(
0140 status,
0141 RTEMS_INVALID_ADDRESS,
0142 "rtems_port_external_to_internal with NULL param"
0143 );
0144 puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
0145
0146 status = rtems_port_internal_to_external(
0147 100,
0148 Internal_port_area,
0149 &converted
0150 );
0151 fatal_directive_status(
0152 status,
0153 RTEMS_INVALID_ID,
0154 "rtems_port_internal_to_external with illegal id"
0155 );
0156 puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
0157
0158 status = rtems_port_internal_to_external(
0159 100,
0160 Internal_port_area,
0161 NULL
0162 );
0163 fatal_directive_status(
0164 status,
0165 RTEMS_INVALID_ADDRESS,
0166 "rtems_port_internal_to_external with NULL param"
0167 );
0168 puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
0169
0170 TEST_END();
0171 }