Changeset c9c05a0 in rtems


Ignore:
Timestamp:
Aug 1, 2009, 9:47:09 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
1d4005db
Parents:
fb29a8de
Message:

2009-08-01 Joel Sherrill <joel.sherrill@…>

  • psx07/init.c, psx07/psx07.scn, psx07/task.c: Add test for budget and replenish period of zero.
Location:
testsuites/psxtests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    rfb29a8de rc9c05a0  
     12009-08-01      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * psx07/init.c, psx07/psx07.scn, psx07/task.c: Add test for budget and
     4        replenish period of zero.
     5
    162009-07-30      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • testsuites/psxtests/psx07/init.c

    rfb29a8de rc9c05a0  
    6868  /* exercise init and destroy */
    6969
    70   puts( "Init: pthread_attr_init - EINVAL (NULL attr)" );
     70  puts( "Init - pthread_attr_init - EINVAL (NULL attr)" );
    7171  status = pthread_attr_init( NULL );
    7272  fatal_directive_check_status_only( status, EINVAL, "null attribute" );
    7373
    74   puts( "Init: pthread_attr_init - SUCCESSFUL" );
     74  puts( "Init - pthread_attr_init - SUCCESSFUL" );
    7575  status = pthread_attr_init( &attr );
    7676  posix_service_failed( status, "pthread_attr_init" );
    7777
    78   puts( "Init: initialize and destroy an attribute - SUCCESSFUL" );
     78  puts( "Init - initialize and destroy an attribute - SUCCESSFUL" );
    7979  status = pthread_attr_init( &destroyed_attr );
    8080  posix_service_failed( status, "pthread_attr_init");
     
    8383  posix_service_failed( status, "pthread_attr_destroy");
    8484
    85   puts( "Init: pthread_attr_destroy - EINVAL (NULL attr)" );
     85  puts( "Init - pthread_attr_destroy - EINVAL (NULL attr)" );
    8686  status = pthread_attr_destroy( NULL );
    8787  fatal_directive_check_status_only( status, EINVAL, "NULL attribute" );
    8888
    89   puts( "Init: pthread_attr_destroy - EINVAL (not initialized)" );
     89  puts( "Init - pthread_attr_destroy - EINVAL (not initialized)" );
    9090  status = pthread_attr_destroy( &destroyed_attr );
    9191  fatal_directive_check_status_only( status, EINVAL, "not initialized" );
     
    9393  /* check some errors in pthread_create */
    9494
    95   puts( "Init: pthread_create - EINVAL (attr not initialized)" );
     95  puts( "Init - pthread_create - EINVAL (attr not initialized)" );
    9696  status = pthread_create( &Task_id, &destroyed_attr, Task_1, NULL );
    9797  fatal_directive_check_status_only( status, EINVAL, "attribute not initialized" );
     
    104104  attr.stacksize = 0;
    105105
    106   puts( "Init: pthread_create - EINVAL (stacksize too small)" );
     106  puts( "Init - pthread_create - EINVAL (stacksize too small)" );
    107107  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    108108  fatal_directive_check_status_only( status, EINVAL, "stacksize too small" );
     
    113113 
    114114  attr.stacksize = rtems_configuration_get_work_space_size() * 10;
    115   puts( "Init: pthread_create - EAGAIN (stacksize too large)" );
     115  puts( "Init - pthread_create - EAGAIN (stacksize too large)" );
    116116  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    117117  fatal_directive_check_status_only( status, EAGAIN, "stacksize too large" );
     
    123123  attr.inheritsched = -1;
    124124
    125   puts( "Init: pthread_create - EINVAL (invalid inherit scheduler)" );
     125  puts( "Init - pthread_create - EINVAL (invalid inherit scheduler)" );
    126126  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    127127  fatal_directive_check_status_only( status, EINVAL, "invalid inherit scheduler" );
     
    133133
    134134  /* Check out pthread_attr_settime and pthread_attr_gettime */
    135   puts( "Init: pthread_attr_settime - EINVAL ( null attribute )" );
     135  puts( "Init - pthread_attr_settime - EINVAL ( null attribute )" );
    136136  status = pthread_attr_setcputime( NULL, CLOCK_ENABLED );
    137137  fatal_directive_check_status_only( status, EINVAL, "null attribute" );
    138138
    139   puts( "Init: pthread_attr_gettime - EINVAL ( null attribute )" );
     139  puts( "Init - pthread_attr_gettime - EINVAL ( null attribute )" );
    140140  status = pthread_attr_getcputime( NULL, &clock_allowed );
    141141  fatal_directive_check_status_only( status, EINVAL, " null attribute" );
    142142
    143   puts( "Init: pthread_attr_settime - EINVAL ( is initialized )" );
     143  puts( "Init - pthread_attr_settime - EINVAL ( is initialized )" );
    144144  status = pthread_attr_setcputime( &destroyed_attr, CLOCK_ENABLED );
    145145  fatal_directive_check_status_only( status, EINVAL, "is initialized" );
    146146
    147   puts( "Init: pthread_attr_gettime - EINVAL ( is initialized )" );
     147  puts( "Init - pthread_attr_gettime - EINVAL ( is initialized )" );
    148148  status = pthread_attr_getcputime( &destroyed_attr, &clock_allowed  );
    149149  fatal_directive_check_status_only( status, EINVAL, "is initialized" );
    150150
    151   puts( "Init: pthread_attr_settime - EINVAL ( invalid clock allowed )" );
     151  puts( "Init - pthread_attr_settime - EINVAL ( invalid clock allowed )" );
    152152  status = pthread_attr_setcputime( &attr, ~(CLOCK_ENABLED | CLOCK_DISABLED) );
    153153  fatal_directive_check_status_only( status, EINVAL, "invalid clock allowed" );
    154154
    155   puts( "Init: pthread_attr_gettime - EINVAL ( NULL clock allowed )" );
     155  puts( "Init - pthread_attr_gettime - EINVAL ( NULL clock allowed )" );
    156156  status = pthread_attr_getcputime( &attr, NULL );
    157157  fatal_directive_check_status_only( status, EINVAL, "NULL clock allowed" );
    158158
    159   puts( "Init: validate pthread_attr_setcputime - CLOCK_DISABLED" );
     159  puts( "Init - validate pthread_attr_setcputime - CLOCK_DISABLED" );
    160160  status = pthread_attr_setcputime( &attr, CLOCK_DISABLED );
    161161  posix_service_failed( status, "pthread_attr_setcputime");
     
    165165    perror("ERROR==> pthread_attr_setcputime to CLOCK_DISABLED failed");
    166166
    167   puts( "Init: validate pthread_attr_setcputime - CLOCK_ENABLED" );
     167  puts( "Init - validate pthread_attr_setcputime - CLOCK_ENABLED" );
    168168  status = pthread_attr_setcputime( &attr, CLOCK_ENABLED );
    169169  posix_service_failed( status, "pthread_attr_setcputime");
     
    176176  attr.contentionscope = PTHREAD_SCOPE_SYSTEM;
    177177
    178   puts( "Init: pthread_create - ENOTSUP (unsupported system contention scope)" );
     178  puts( "Init - pthread_create - ENOTSUP (unsupported system contention scope)" );
    179179  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    180180  fatal_directive_check_status_only( status, ENOTSUP,
     
    189189  posix_service_failed( status, "pthread_attr_setinheritsched");
    190190
    191   puts( "Init: pthread_create - SUCCESSFUL (inherit scheduler)" );
     191  puts( "Init - pthread_create - SUCCESSFUL (inherit scheduler)" );
    192192  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    193193  posix_service_failed( status, "pthread_create");
     
    205205  posix_service_failed( status, "pthread_attr_init");
    206206
    207   puts( "Init: pthread_attr_setscope - EINVAL (NULL attr)" );
     207  puts( "Init - pthread_attr_setscope - EINVAL (NULL attr)" );
    208208  status = pthread_attr_setscope( NULL, PTHREAD_SCOPE_PROCESS );
    209209  fatal_directive_check_status_only( status, EINVAL , "NULL attr" );
    210210
    211   puts( "Init: pthread_attr_setscope - ENOTSUP" );
     211  puts( "Init - pthread_attr_setscope - ENOTSUP" );
    212212  status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
    213213  fatal_directive_check_status_only( status, ENOTSUP, "PTHREAD_SCOPE_SYSTEM" );
    214214
    215   puts( "Init: pthread_attr_setscope - EINVAL (not initialized attr)" );
     215  puts( "Init - pthread_attr_setscope - EINVAL (not initialized attr)" );
    216216  status = pthread_attr_setscope( &destroyed_attr, PTHREAD_SCOPE_PROCESS );
    217217  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    218218
    219   puts( "Init: pthread_attr_setscope - EINVAL (invalid scope)" );
     219  puts( "Init - pthread_attr_setscope - EINVAL (invalid scope)" );
    220220  status = pthread_attr_setscope( &attr, -1 );
    221221  fatal_directive_check_status_only( status, EINVAL, "invalid scope" );
    222222
    223   puts( "Init: pthread_attr_setscope - SUCCESSFUL" );
     223  puts( "Init - pthread_attr_setscope - SUCCESSFUL" );
    224224  status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_PROCESS );
    225225  posix_service_failed( status, "pthread_attr_setscope");
    226226
    227   puts( "Init: pthread_attr_getscope - EINVAL (NULL attr)" );
     227  puts( "Init - pthread_attr_getscope - EINVAL (NULL attr)" );
    228228  status = pthread_attr_getscope( NULL, &scope );
    229229  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    230230
    231   puts( "Init: pthread_attr_getscope - EINVAL (NULL scope)" );
     231  puts( "Init - pthread_attr_getscope - EINVAL (NULL scope)" );
    232232  status = pthread_attr_getscope( &attr, NULL );
    233233  fatal_directive_check_status_only( status, EINVAL, "NULL scope" );
    234234
    235   puts( "Init: pthread_attr_getscope - EINVAL (not initialized attr)" );
     235  puts( "Init - pthread_attr_getscope - EINVAL (not initialized attr)" );
    236236  status = pthread_attr_getscope( &destroyed_attr, &scope );
    237237  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    238238
    239   puts( "Init: pthread_attr_getscope - SUCCESSFUL" );
     239  puts( "Init - pthread_attr_getscope - SUCCESSFUL" );
    240240  status = pthread_attr_getscope( &attr, &scope );
    241241  posix_service_failed( status, "pthread_attr_getscope");
    242   printf( "Init: current scope attribute = %d\n", scope );
     242  printf( "Init - current scope attribute = %d\n", scope );
    243243
    244244  /* exercise get and set inherit scheduler */
     
    246246  empty_line();
    247247
    248   puts( "Init: pthread_attr_setinheritsched - EINVAL (NULL attr)" );
     248  puts( "Init - pthread_attr_setinheritsched - EINVAL (NULL attr)" );
    249249  status = pthread_attr_setinheritsched( NULL, PTHREAD_INHERIT_SCHED );
    250250  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    251251
    252   puts( "Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)" );
     252  puts( "Init - pthread_attr_setinheritsched - EINVAL (not initialized attr)" );
    253253  status =
    254254     pthread_attr_setinheritsched( &destroyed_attr, PTHREAD_INHERIT_SCHED );
    255255  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    256256
    257   puts( "Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)" );
     257  puts( "Init - pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)" );
    258258  status = pthread_attr_setinheritsched( &attr, -1 );
    259259  fatal_directive_check_status_only( status, ENOTSUP, "invalid inheritsched" );
    260260
    261   puts( "Init: pthread_attr_setinheritsched - SUCCESSFUL" );
     261  puts( "Init - pthread_attr_setinheritsched - SUCCESSFUL" );
    262262  status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED );
    263263  posix_service_failed( status, "pthread_attr_setinheritsched");
    264264
    265   puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL attr)" );
     265  puts( "Init - pthread_attr_getinheritsched - EINVAL (NULL attr)" );
    266266  status = pthread_attr_getinheritsched( NULL, &inheritsched );
    267267  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    268268
    269   puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)" );
     269  puts( "Init - pthread_attr_getinheritsched - EINVAL (NULL inheritsched)" );
    270270  status = pthread_attr_getinheritsched( &attr, NULL );
    271271  fatal_directive_check_status_only( status, EINVAL, "NULL inheritsched" );
    272272
    273   puts( "Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)" );
     273  puts( "Init - pthread_attr_getinheritsched - EINVAL (not initialized attr)" );
    274274  status = pthread_attr_getinheritsched( &destroyed_attr, &inheritsched );
    275275  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    276276
    277   puts( "Init: pthread_attr_getinheritsched - SUCCESSFUL" );
     277  puts( "Init - pthread_attr_getinheritsched - SUCCESSFUL" );
    278278  status = pthread_attr_getinheritsched( &attr, &inheritsched );
    279279  posix_service_failed( status, "pthread_attr_getinheritsched");
    280   printf( "Init: current inherit scheduler attribute = %d\n", inheritsched );
     280  printf( "Init - current inherit scheduler attribute = %d\n", inheritsched );
    281281
    282282  /* exercise get and set inherit scheduler */
     
    284284  empty_line();
    285285
    286   puts( "Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)" );
     286  puts( "Init - pthread_attr_setschedpolicy - EINVAL (NULL attr)" );
    287287  status = pthread_attr_setschedpolicy( NULL, SCHED_FIFO );
    288288  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    289289
    290   puts( "Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)" );
     290  puts( "Init - pthread_attr_setschedpolicy - EINVAL (not initialized attr)" );
    291291  status =
    292292     pthread_attr_setschedpolicy( &destroyed_attr, SCHED_OTHER );
    293293  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    294294
    295   puts( "Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)" );
     295  puts( "Init - pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)" );
    296296  status = pthread_attr_setschedpolicy( &attr, -1 );
    297297  fatal_directive_check_status_only( status, ENOTSUP, "invalid schedpolicy" );
    298298
    299   puts( "Init: pthread_attr_setschedpolicy - SUCCESSFUL" );
     299  puts( "Init - pthread_attr_setschedpolicy - SUCCESSFUL" );
    300300  status = pthread_attr_setschedpolicy( &attr, SCHED_RR );
    301301  posix_service_failed( status, "pthread_attr_setschedpolicy");
    302302
    303   puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)" );
     303  puts( "Init - pthread_attr_getschedpolicy - EINVAL (NULL attr)" );
    304304  status = pthread_attr_getschedpolicy( NULL, &schedpolicy );
    305305  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    306306
    307   puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)" );
     307  puts( "Init - pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)" );
    308308  status = pthread_attr_getschedpolicy( &attr, NULL );
    309309  fatal_directive_check_status_only( status, EINVAL, "NULL schedpolicy" );
    310310
    311   puts( "Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)" );
     311  puts( "Init - pthread_attr_getschedpolicy - EINVAL (not initialized attr)" );
    312312  status = pthread_attr_getschedpolicy( &destroyed_attr, &schedpolicy );
    313313  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    314314
    315   puts( "Init: pthread_attr_getschedpolicy - SUCCESSFUL" );
     315  puts( "Init - pthread_attr_getschedpolicy - SUCCESSFUL" );
    316316  status = pthread_attr_getschedpolicy( &attr, &schedpolicy );
    317317  posix_service_failed( status, "pthread_attr_getschedpolicy");
    318   printf( "Init: current scheduler policy attribute = %d\n", schedpolicy );
     318  printf( "Init - current scheduler policy attribute = %d\n", schedpolicy );
    319319
    320320  /* exercise get and set stack size */
     
    322322  empty_line();
    323323
    324   puts( "Init: pthread_attr_setstacksize - EINVAL (NULL attr)" );
     324  puts( "Init - pthread_attr_setstacksize - EINVAL (NULL attr)" );
    325325  status = pthread_attr_setstacksize( NULL, 0 );
    326326  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    327327
    328   puts( "Init: pthread_attr_setstacksize - EINVAL (not initialized attr)" );
     328  puts( "Init - pthread_attr_setstacksize - EINVAL (not initialized attr)" );
    329329  status =
    330330     pthread_attr_setstacksize( &destroyed_attr, 0 );
    331331  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    332332
    333   puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)" );
     333  puts( "Init - pthread_attr_setstacksize - SUCCESSFUL (low stacksize)" );
    334334  status = pthread_attr_setstacksize( &attr, 0 );
    335335  posix_service_failed( status, "pthread_attr_setstacksize");
    336336
    337   puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)" );
     337  puts( "Init - pthread_attr_setstacksize - SUCCESSFUL (high stacksize)" );
    338338  status = pthread_attr_setstacksize( &attr, STACK_MINIMUM_SIZE * 2 );
    339339  posix_service_failed( status, "");
    340340
    341   puts( "Init: pthread_attr_getstacksize - EINVAL (NULL attr)" );
     341  puts( "Init - pthread_attr_getstacksize - EINVAL (NULL attr)" );
    342342  status = pthread_attr_getstacksize( NULL, &stacksize );
    343343  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    344344
    345   puts( "Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)" );
     345  puts( "Init - pthread_attr_getstacksize - EINVAL (NULL stacksize)" );
    346346  status = pthread_attr_getstacksize( &attr, NULL );
    347347  fatal_directive_check_status_only( status, EINVAL, "NULL stacksize" );
    348348
    349   puts( "Init: pthread_attr_getstacksize - EINVAL (not initialized attr)" );
     349  puts( "Init - pthread_attr_getstacksize - EINVAL (not initialized attr)" );
    350350  status = pthread_attr_getstacksize( &destroyed_attr, &stacksize );
    351351  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    352352
    353   puts( "Init: pthread_attr_getstacksize - SUCCESSFUL" );
     353  puts( "Init - pthread_attr_getstacksize - SUCCESSFUL" );
    354354  status = pthread_attr_getstacksize( &attr, &stacksize );
    355355  posix_service_failed( status, "pthread_attr_getstacksize");
    356356  if ( stacksize == (STACK_MINIMUM_SIZE * 2) )
    357     printf( "Init: current stack size attribute is OK\n" );
     357    printf( "Init - current stack size attribute is OK\n" );
    358358
    359359  /* exercise get and set stack address */
     
    361361  empty_line();
    362362
    363   puts( "Init: pthread_attr_setstackaddr - EINVAL (NULL attr)" );
     363  puts( "Init - pthread_attr_setstackaddr - EINVAL (NULL attr)" );
    364364  status = pthread_attr_setstackaddr( NULL, NULL );
    365365  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    366366
    367   puts( "Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)" );
     367  puts( "Init - pthread_attr_setstackaddr - EINVAL (not initialized attr)" );
    368368  status =
    369369     pthread_attr_setstackaddr( &destroyed_attr, NULL );
    370370  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    371371
    372   puts( "Init: pthread_attr_setstackaddr - SUCCESSFUL" );
     372  puts( "Init - pthread_attr_setstackaddr - SUCCESSFUL" );
    373373  status = pthread_attr_setstackaddr( &attr, 0 );
    374374  posix_service_failed( status, "");
    375375
    376   puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL attr)" );
     376  puts( "Init - pthread_attr_getstackaddr - EINVAL (NULL attr)" );
    377377  status = pthread_attr_getstackaddr( NULL, &stackaddr );
    378378  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    379379
    380   puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)" );
     380  puts( "Init - pthread_attr_getstackaddr - EINVAL (NULL stackaddr)" );
    381381  status = pthread_attr_getstackaddr( &attr, NULL );
    382382  fatal_directive_check_status_only( status, EINVAL, "NULL stackaddr" );
    383383
    384   puts( "Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)" );
     384  puts( "Init - pthread_attr_getstackaddr - EINVAL (not initialized attr)" );
    385385  status = pthread_attr_getstackaddr( &destroyed_attr, &stackaddr );
    386386  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    387387
    388   puts( "Init: pthread_attr_getstackaddr - SUCCESSFUL" );
     388  puts( "Init - pthread_attr_getstackaddr - SUCCESSFUL" );
    389389  status = pthread_attr_getstackaddr( &attr, &stackaddr );
    390390  posix_service_failed( status, "pthread_attr_getstackaddr");
    391   printf( "Init: current stack address attribute = %p\n", stackaddr );
     391  printf( "Init - current stack address attribute = %p\n", stackaddr );
    392392
    393393  /* exercise get and set detach state */
     
    395395  empty_line();
    396396
    397   puts( "Init: pthread_attr_setdetachstate - EINVAL (NULL attr)" );
     397  puts( "Init - pthread_attr_setdetachstate - EINVAL (NULL attr)" );
    398398  status = pthread_attr_setdetachstate( NULL, PTHREAD_CREATE_DETACHED );
    399399  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    400400
    401   puts( "Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)" );
     401  puts( "Init - pthread_attr_setdetachstate - EINVAL (not initialized attr)" );
    402402  status =
    403403     pthread_attr_setdetachstate( &destroyed_attr, PTHREAD_CREATE_JOINABLE );
    404404  fatal_directive_check_status_only( status, EINVAL, "not initialized att" );
    405405
    406   puts( "Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)" );
     406  puts( "Init - pthread_attr_setdetachstate - EINVAL (invalid detachstate)" );
    407407  status = pthread_attr_setdetachstate( &attr, -1 );
    408408  fatal_directive_check_status_only( status, EINVAL, "invalid detachstate" );
    409409
    410   puts( "Init: pthread_attr_setdetachstate - SUCCESSFUL" );
     410  puts( "Init - pthread_attr_setdetachstate - SUCCESSFUL" );
    411411  status = pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE );
    412412  posix_service_failed( status, "pthread_attr_setdetachstate");
    413413
    414   puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL attr)" );
     414  puts( "Init - pthread_attr_getdetachstate - EINVAL (NULL attr)" );
    415415  status = pthread_attr_getdetachstate( NULL, &detachstate );
    416416  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    417417
    418   puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)" );
     418  puts( "Init - pthread_attr_getdetachstate - EINVAL (NULL detatchstate)" );
    419419  status = pthread_attr_getdetachstate( &attr, NULL );
    420420  fatal_directive_check_status_only( status, EINVAL, "NULL detatchstate" );
    421421
    422   puts( "Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)" );
     422  puts( "Init - pthread_attr_getdetachstate - EINVAL (not initialized attr)" );
    423423  status = pthread_attr_getdetachstate( &destroyed_attr, &detachstate );
    424424  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    425425
    426   puts( "Init: pthread_attr_getdetachstate - SUCCESSFUL" );
     426  puts( "Init - pthread_attr_getdetachstate - SUCCESSFUL" );
    427427  status = pthread_attr_getdetachstate( &attr, &detachstate );
    428428  posix_service_failed( status, "pthread_attr_getdetachstate");
    429   printf( "Init: current detach state attribute = %d\n", detachstate );
     429  printf( "Init - current detach state attribute = %d\n", detachstate );
    430430
    431431  /* exercise get and set scheduling parameters */
     
    433433  empty_line();
    434434
    435   puts( "Init: pthread_attr_getschedparam - SUCCESSFUL" );
     435  puts( "Init - pthread_attr_getschedparam - SUCCESSFUL" );
    436436  status = pthread_attr_getschedparam( &attr, &schedparam );
    437437  posix_service_failed( status, "pthread_attr_getschedparam");
    438438
    439   print_schedparam( "Init: ", &schedparam );
    440 
    441   puts( "Init: pthread_attr_setschedparam - EINVAL (NULL attr)" );
     439  print_schedparam( "Init - ", &schedparam );
     440
     441  puts( "Init - pthread_attr_setschedparam - EINVAL (NULL attr)" );
    442442  status = pthread_attr_setschedparam( NULL, &schedparam );
    443443  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
    444444
    445   puts( "Init: pthread_attr_setschedparam - EINVAL (not initialized attr)" );
     445  puts( "Init - pthread_attr_setschedparam - EINVAL (not initialized attr)" );
    446446  status = pthread_attr_setschedparam( &destroyed_attr, &schedparam );
    447447  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    448448
    449   puts( "Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)" );
     449  puts( "Init - pthread_attr_setschedparam - EINVAL (NULL schedparam)" );
    450450  status = pthread_attr_setschedparam( &attr, NULL );
    451451  fatal_directive_check_status_only( status, EINVAL, "NULL schedparam" );
    452452
    453   puts( "Init: pthread_attr_setschedparam - SUCCESSFUL" );
     453  puts( "Init - pthread_attr_setschedparam - SUCCESSFUL" );
    454454  status = pthread_attr_setschedparam( &attr, &schedparam );
    455455  posix_service_failed( status, "pthread_attr_setschedparam");
    456456
    457   puts( "Init: pthread_attr_getschedparam - EINVAL (NULL attr)" );
     457  puts( "Init - pthread_attr_getschedparam - EINVAL (NULL attr)" );
    458458  status = pthread_attr_getschedparam( NULL, &schedparam );
    459459  fatal_directive_check_status_only( status, EINVAL, "pthread_attr_getschedparam" );
    460460
    461   puts( "Init: pthread_attr_getschedparam - EINVAL (not initialized attr)" );
     461  puts( "Init - pthread_attr_getschedparam - EINVAL (not initialized attr)" );
    462462  status = pthread_attr_getschedparam( &destroyed_attr, &schedparam );
    463463  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    464464
    465   puts( "Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)" );
     465  puts( "Init - pthread_attr_getschedparam - EINVAL (NULL schedparam)" );
    466466  status = pthread_attr_getschedparam( &attr, NULL );
    467467  fatal_directive_check_status_only( status, EINVAL, "NULL schedparam" );
     
    471471  empty_line();
    472472
    473   puts( "Init: pthread_getschedparam - EINVAL (NULL policy)" );
     473  puts( "Init - pthread_getschedparam - EINVAL (NULL policy)" );
    474474  status = pthread_getschedparam( pthread_self(), NULL, &schedparam );
    475475  fatal_directive_check_status_only( status, EINVAL, "NULL policy" );
    476476
    477   puts( "Init: pthread_getschedparam - EINVAL (NULL schedparam)" );
     477  puts( "Init - pthread_getschedparam - EINVAL (NULL schedparam)" );
    478478  status = pthread_getschedparam( pthread_self(), &schedpolicy, NULL );
    479479  fatal_directive_check_status_only( status, EINVAL, "NULL schedparam" );
    480480
    481   puts( "Init: pthread_getschedparam - ESRCH (bad thread)" );
     481  puts( "Init - pthread_getschedparam - ESRCH (bad thread)" );
    482482  status = pthread_getschedparam( (pthread_t) -1, &schedpolicy, &schedparam );
    483483  fatal_directive_check_status_only( status, ESRCH, "bad thread" );
    484484
    485   puts( "Init: pthread_getschedparam - SUCCESSFUL" );
     485  puts( "Init - pthread_getschedparam - SUCCESSFUL" );
    486486  status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam );
    487487  posix_service_failed( status, "pthread_getschedparam");
    488488
    489   printf( "Init: policy = %d\n", schedpolicy );
    490 
    491   print_schedparam( "Init: ", &schedparam );
     489  printf( "Init - policy = %d\n", schedpolicy );
     490
     491  print_schedparam( "Init - ", &schedparam );
    492492
    493493  /* exercise pthread_setschedparam */
     
    495495  empty_line();
    496496
    497   puts( "Init: pthread_setschedparam - EINVAL (NULL schedparam)" );
     497  puts( "Init - pthread_setschedparam - EINVAL (NULL schedparam)" );
    498498  status = pthread_setschedparam( pthread_self(), SCHED_OTHER, NULL );
    499499  fatal_directive_check_status_only( status, EINVAL, "NULL schedparam" );
     
    501501  schedparam.sched_priority = -1;
    502502
    503   puts( "Init: pthread_setschedparam - EINVAL (invalid priority)" );
     503  puts( "Init - pthread_setschedparam - EINVAL (invalid priority)" );
    504504  status = pthread_setschedparam( pthread_self(), SCHED_OTHER, NULL );
    505505  fatal_directive_check_status_only( status, EINVAL, "invalid priority" );
     
    509509  posix_service_failed( status, "pthread_getschedparam");
    510510
    511   puts( "Init: pthread_setschedparam - EINVAL (invalid policy)" );
     511  puts( "Init - pthread_setschedparam - EINVAL (invalid policy)" );
    512512  status = pthread_setschedparam( pthread_self(), -1, &schedparam );
    513513  fatal_directive_check_status_only( status, EINVAL, "invalid policy" );
    514514
    515   puts( "Init: pthread_setschedparam - ESRCH (invalid thread)" );
     515  puts( "Init - pthread_setschedparam - ESRCH (invalid thread)" );
    516516  status = pthread_setschedparam( (pthread_t) -1, SCHED_OTHER, &schedparam );
    517517  fatal_directive_check_status_only( status, ESRCH, "invalid thread" );
    518518
    519519  /* now get sporadic server errors */
     520
     521  schedparam.ss_replenish_period.tv_sec = 0;
     522  schedparam.ss_replenish_period.tv_nsec = 0;
     523  schedparam.ss_initial_budget.tv_sec = 1;
     524  schedparam.ss_initial_budget.tv_nsec = 1;
     525
     526  puts( "Init - pthread_setschedparam - EINVAL (replenish == 0)" );
     527  status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
     528  fatal_directive_check_status_only( status, EINVAL, "replenish == 0" );
     529
     530  schedparam.ss_replenish_period.tv_sec = 1;
     531  schedparam.ss_replenish_period.tv_nsec = 1;
     532  schedparam.ss_initial_budget.tv_sec = 0;
     533  schedparam.ss_initial_budget.tv_nsec = 0;
     534
     535  puts( "Init - pthread_setschedparam - EINVAL (budget == 0)" );
     536  status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
     537  fatal_directive_check_status_only( status, EINVAL, "budget == 0" );
    520538
    521539  schedparam.ss_replenish_period.tv_sec = 1;
     
    524542  schedparam.ss_initial_budget.tv_nsec = 1;
    525543
    526   puts( "Init: pthread_setschedparam - EINVAL (replenish < budget)" );
     544  puts( "Init - pthread_setschedparam - EINVAL (replenish < budget)" );
    527545  status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
    528546  fatal_directive_check_status_only( status, EINVAL, "replenish < budget" );
     
    534552  schedparam.ss_low_priority = -1;
    535553
    536   puts( "Init: pthread_setschedparam - EINVAL (invalid priority)" );
     554  puts( "Init - pthread_setschedparam - EINVAL (invalid priority)" );
    537555  status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam );
    538556  fatal_directive_check_status_only( status, EINVAL, "invalid priority" );
  • testsuites/psxtests/psx07/psx07.scn

    rfb29a8de rc9c05a0  
    11*** POSIX TEST 7 ***
    22Init's ID is 0x0b010001
    3 Init: pthread_attr_init - EINVAL (NULL attr)
    4 Init: pthread_attr_init - SUCCESSFUL
    5 Init: initialize and destroy an attribute - SUCCESSFUL
    6 Init: pthread_attr_destroy - EINVAL (NULL attr)
    7 Init: pthread_attr_destroy - EINVAL (not initialized)
    8 Init: pthread_create - EINVAL (attr not initialized)
    9 Init: pthread_create - EINVAL (stacksize too small)
    10 Init: pthread_create - EAGAIN (stacksize too large)
    11 Init: pthread_create - EINVAL (invalid inherit scheduler)
    12 Init: pthread_create - ENOTSUP (unsupported system contention scope)
    13 Init: pthread_create - SUCCESSFUL (inherit scheduler)
    14 Task_1: exitting
    15 Init: pthread_attr_setscope - EINVAL (NULL attr)
    16 Init: pthread_attr_setscope - ENOTSUP
    17 Init: pthread_attr_setscope - EINVAL (not initialized attr)
    18 Init: pthread_attr_setscope - EINVAL (invalid scope)
    19 Init: pthread_attr_setscope - SUCCESSFUL
    20 Init: pthread_attr_getscope - EINVAL (NULL attr)
    21 Init: pthread_attr_getscope - EINVAL (NULL scope)
    22 Init: pthread_attr_getscope - EINVAL (not initialized attr)
    23 Init: pthread_attr_getscope - SUCCESSFUL
    24 Init: current scope attribute = 0
    25 Init: pthread_attr_setinheritsched - EINVAL (NULL attr)
    26 Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)
    27 Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)
    28 Init: pthread_attr_setinheritsched - SUCCESSFUL
    29 Init: pthread_attr_getinheritsched - EINVAL (NULL attr)
    30 Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)
    31 Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)
    32 Init: pthread_attr_getinheritsched - SUCCESSFUL
    33 Init: current inherit scheduler attribute = 1
    34 Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)
    35 Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)
    36 Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)
    37 Init: pthread_attr_setschedpolicy - SUCCESSFUL
    38 Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)
    39 Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)
    40 Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)
    41 Init: pthread_attr_getschedpolicy - SUCCESSFUL
    42 Init: current scheduler policy attribute = 2
    43 Init: pthread_attr_setstacksize - EINVAL (NULL attr)
    44 Init: pthread_attr_setstacksize - EINVAL (not initialized attr)
    45 Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)
    46 Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)
    47 Init: pthread_attr_getstacksize - EINVAL (NULL attr)
    48 Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)
    49 Init: pthread_attr_getstacksize - EINVAL (not initialized attr)
    50 Init: pthread_attr_getstacksize - SUCCESSFUL
    51 Init: current stack size attribute is OK
    52 Init: pthread_attr_setstackaddr - EINVAL (NULL attr)
    53 Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)
    54 Init: pthread_attr_setstackaddr - SUCCESSFUL
    55 Init: pthread_attr_getstackaddr - EINVAL (NULL attr)
    56 Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)
    57 Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)
    58 Init: pthread_attr_getstackaddr - SUCCESSFUL
    59 Init: current stack address attribute = 0x0
    60 Init: pthread_attr_setdetachstate - EINVAL (NULL attr)
    61 Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)
    62 Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)
    63 Init: pthread_attr_setdetachstate - SUCCESSFUL
    64 Init: pthread_attr_getdetachstate - EINVAL (NULL attr)
    65 Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)
    66 Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)
    67 Init: pthread_attr_getdetachstate - SUCCESSFUL
    68 Init: current detach state attribute = 1
    69 Init: pthread_attr_getschedparam - SUCCESSFUL
    70 Init: sched priority      = 2
    71 Init: ss_low_priority     = 0
    72 Init: ss_replenish_period = (0, 0)
    73 Init: ss_initial_budget = (0, 0)
    74 Init: pthread_attr_setschedparam - EINVAL (NULL attr)
    75 Init: pthread_attr_setschedparam - EINVAL (not initialized attr)
    76 Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)
    77 Init: pthread_attr_setschedparam - SUCCESSFUL
    78 Init: pthread_attr_getschedparam - EINVAL (NULL attr)
    79 Init: pthread_attr_getschedparam - EINVAL (not initialized attr)
    80 Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)
    81 Init: pthread_getschedparam - EINVAL (NULL policy)
    82 Init: pthread_getschedparam - EINVAL (NULL schedparam)
    83 Init: pthread_getschedparam - ESRCH (bad thread)
    84 Init: pthread_getschedparam - SUCCESSFUL
    85 Init: policy = 1
    86 Init: sched priority      = 2
    87 Init: ss_low_priority     = 0
    88 Init: ss_replenish_period = (0, 0)
    89 Init: ss_initial_budget = (0, 0)
    90 Init: pthread_setschedparam - EINVAL (NULL schedparam)
    91 Init: pthread_setschedparam - EINVAL (invalid priority)
    92 Init: pthread_setschedparam - EINVAL (invalid policy)
    93 Init: pthread_setschedparam - ESRCH (invalid thread)
    94 Init: pthread_setschedparam - EINVAL (replenish < budget)
    95 Init: pthread_setschedparam - EINVAL (invalid priority)
     3Init - pthread_attr_init - EINVAL (NULL attr)
     4Init - pthread_attr_init - SUCCESSFUL
     5Init - initialize and destroy an attribute - SUCCESSFUL
     6Init - pthread_attr_destroy - EINVAL (NULL attr)
     7Init - pthread_attr_destroy - EINVAL (not initialized)
     8Init - pthread_create - EINVAL (attr not initialized)
     9Init - pthread_create - EINVAL (stacksize too small)
     10Init - pthread_create - EAGAIN (stacksize too large)
     11Init - pthread_create - EINVAL (invalid inherit scheduler)
     12Init - pthread_create - ENOTSUP (unsupported system contention scope)
     13Init - pthread_create - SUCCESSFUL (inherit scheduler)
     14Task_1 - exitting
     15Init - pthread_attr_setscope - EINVAL (NULL attr)
     16Init - pthread_attr_setscope - ENOTSUP
     17Init - pthread_attr_setscope - EINVAL (not initialized attr)
     18Init - pthread_attr_setscope - EINVAL (invalid scope)
     19Init - pthread_attr_setscope - SUCCESSFUL
     20Init - pthread_attr_getscope - EINVAL (NULL attr)
     21Init - pthread_attr_getscope - EINVAL (NULL scope)
     22Init - pthread_attr_getscope - EINVAL (not initialized attr)
     23Init - pthread_attr_getscope - SUCCESSFUL
     24Init - current scope attribute = 0
     25Init - pthread_attr_setinheritsched - EINVAL (NULL attr)
     26Init - pthread_attr_setinheritsched - EINVAL (not initialized attr)
     27Init - pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)
     28Init - pthread_attr_setinheritsched - SUCCESSFUL
     29Init - pthread_attr_getinheritsched - EINVAL (NULL attr)
     30Init - pthread_attr_getinheritsched - EINVAL (NULL inheritsched)
     31Init - pthread_attr_getinheritsched - EINVAL (not initialized attr)
     32Init - pthread_attr_getinheritsched - SUCCESSFUL
     33Init - current inherit scheduler attribute = 1
     34Init - pthread_attr_setschedpolicy - EINVAL (NULL attr)
     35Init - pthread_attr_setschedpolicy - EINVAL (not initialized attr)
     36Init - pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)
     37Init - pthread_attr_setschedpolicy - SUCCESSFUL
     38Init - pthread_attr_getschedpolicy - EINVAL (NULL attr)
     39Init - pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)
     40Init - pthread_attr_getschedpolicy - EINVAL (not initialized attr)
     41Init - pthread_attr_getschedpolicy - SUCCESSFUL
     42Init - current scheduler policy attribute = 2
     43Init - pthread_attr_setstacksize - EINVAL (NULL attr)
     44Init - pthread_attr_setstacksize - EINVAL (not initialized attr)
     45Init - pthread_attr_setstacksize - SUCCESSFUL (low stacksize)
     46Init - pthread_attr_setstacksize - SUCCESSFUL (high stacksize)
     47Init - pthread_attr_getstacksize - EINVAL (NULL attr)
     48Init - pthread_attr_getstacksize - EINVAL (NULL stacksize)
     49Init - pthread_attr_getstacksize - EINVAL (not initialized attr)
     50Init - pthread_attr_getstacksize - SUCCESSFUL
     51Init - current stack size attribute is OK
     52Init - pthread_attr_setstackaddr - EINVAL (NULL attr)
     53Init - pthread_attr_setstackaddr - EINVAL (not initialized attr)
     54Init - pthread_attr_setstackaddr - SUCCESSFUL
     55Init - pthread_attr_getstackaddr - EINVAL (NULL attr)
     56Init - pthread_attr_getstackaddr - EINVAL (NULL stackaddr)
     57Init - pthread_attr_getstackaddr - EINVAL (not initialized attr)
     58Init - pthread_attr_getstackaddr - SUCCESSFUL
     59Init - current stack address attribute = 0x0
     60Init - pthread_attr_setdetachstate - EINVAL (NULL attr)
     61Init - pthread_attr_setdetachstate - EINVAL (not initialized attr)
     62Init - pthread_attr_setdetachstate - EINVAL (invalid detachstate)
     63Init - pthread_attr_setdetachstate - SUCCESSFUL
     64Init - pthread_attr_getdetachstate - EINVAL (NULL attr)
     65Init - pthread_attr_getdetachstate - EINVAL (NULL detatchstate)
     66Init - pthread_attr_getdetachstate - EINVAL (not initialized attr)
     67Init - pthread_attr_getdetachstate - SUCCESSFUL
     68Init - current detach state attribute = 1
     69Init - pthread_attr_getschedparam - SUCCESSFUL
     70Init - sched priority      = 2
     71Init - ss_low_priority     = 0
     72Init - ss_replenish_period = (0, 0)
     73Init - ss_initial_budget = (0, 0)
     74Init - pthread_attr_setschedparam - EINVAL (NULL attr)
     75Init - pthread_attr_setschedparam - EINVAL (not initialized attr)
     76Init - pthread_attr_setschedparam - EINVAL (NULL schedparam)
     77Init - pthread_attr_setschedparam - SUCCESSFUL
     78Init - pthread_attr_getschedparam - EINVAL (NULL attr)
     79Init - pthread_attr_getschedparam - EINVAL (not initialized attr)
     80Init - pthread_attr_getschedparam - EINVAL (NULL schedparam)
     81Init - pthread_getschedparam - EINVAL (NULL policy)
     82Init - pthread_getschedparam - EINVAL (NULL schedparam)
     83Init - pthread_getschedparam - ESRCH (bad thread)
     84Init - pthread_getschedparam - SUCCESSFUL
     85Init - policy = 1
     86Init - sched priority      = 2
     87Init - ss_low_priority     = 0
     88Init - ss_replenish_period = (0, 0)
     89Init - ss_initial_budget = (0, 0)
     90Init - pthread_setschedparam - EINVAL (NULL schedparam)
     91Init - pthread_setschedparam - EINVAL (invalid priority)
     92Init - pthread_setschedparam - EINVAL (invalid policy)
     93Init - pthread_setschedparam - ESRCH (invalid thread)
     94Init - pthread_setschedparam - EINVAL (replenish == 0)
     95Init - pthread_setschedparam - EINVAL (budget == 0)
     96Init - pthread_setschedparam - EINVAL (replenish < budget)
     97Init - pthread_setschedparam - EINVAL (invalid priority)
    9698*** END OF POSIX TEST 7 ***
  • testsuites/psxtests/psx07/task.c

    rfb29a8de rc9c05a0  
    2727)
    2828{
    29   puts( "Task_1: exitting" );
     29  puts( "Task_1 - exitting" );
    3030  pthread_exit( NULL );
    3131
Note: See TracChangeset for help on using the changeset viewer.