Changeset 41909de in rtems


Ignore:
Timestamp:
Oct 25, 2011, 4:29:14 PM (8 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, master
Children:
5008f65
Parents:
8ed7d0a
Message:

2011-10-25 Ralf Corsépius <ralf.corsepius@…>

  • psxmsgq01/init.c: Introduce fatal_posix_mqd. Replace fatal_posix_service_pointer_minus_one with fatal_posix_mqd.
  • psxsem01/init.c: Introduce fatal_posix_sem. Replace fatal_posix_service_pointer_minus_one with fatal_posix_sem.
Location:
testsuites/psxtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r8ed7d0a r41909de  
     12011-10-25      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * psxmsgq01/init.c: Introduce fatal_posix_mqd.
     4        Replace fatal_posix_service_pointer_minus_one with fatal_posix_mqd.
     5        * psxsem01/init.c: Introduce fatal_posix_sem.
     6        Replace fatal_posix_service_pointer_minus_one with fatal_posix_sem.
     7
    182011-10-25      Ralf Corsépius <ralf.corsepius@rtems.org>
    29
  • testsuites/psxtests/psxmsgq01/init.c

    r8ed7d0a r41909de  
    2222#include <signal.h>   /* signal facilities */
    2323#include "test_support.h"
     24
     25#define fatal_posix_mqd( _ptr, _msg ) \
     26  if ( (_ptr != (mqd_t) -1) ) { \
     27    check_dispatch_disable_level( 0 ); \
     28    printf( "\n%s FAILED -- expected (-1) got (%" PRId32 " - %d/%s)\n", \
     29            (_msg), _ptr, errno, strerror(errno) ); \
     30    FLUSH_OUTPUT(); \
     31    rtems_test_exit( -1 ); \
     32  }
     33
    2434
    2535typedef struct {
     
    175185  puts( "Init: mq_open - Create with maxmsg (-1) (EINVAL)" );
    176186  n_mq2 = mq_open( "mq2", O_CREAT | O_RDONLY, 0x777, &attr);
    177   fatal_posix_service_pointer_minus_one(
    178     (void *)n_mq2, "mq_open error return status" );
     187  fatal_posix_mqd( n_mq2, "mq_open error return status" );
    179188  fatal_posix_service_status( errno, EINVAL,  "mq_open errno EINVAL");
    180189  attr.mq_maxmsg  = MAXMSG;
     
    187196  puts( "Init: mq_open - Create with msgsize (-1) (EINVAL)" );
    188197  n_mq2 = mq_open( "mq2", O_CREAT | O_RDONLY, 0x777, &attr);
    189   fatal_posix_service_pointer_minus_one(
    190     (void *) n_mq2, "mq_open error return status" );
     198  fatal_posix_mqd( n_mq2, "mq_open error return status" );
    191199  fatal_posix_service_status( errno, EINVAL,  "mq_open errno EINVAL");
    192200  attr.mq_msgsize = MSGSIZE;
     
    198206  puts( "Init: mq_open - Open new mq without create flag (ENOENT)" );
    199207  n_mq2 = mq_open( "mq3", O_EXCL | O_RDONLY, 0x777, NULL);
    200   fatal_posix_service_pointer_minus_one(
    201     (void *) n_mq2, "mq_open error return status" );
     208  fatal_posix_mqd( n_mq2, "mq_open error return status" );
    202209  fatal_posix_service_status( errno, ENOENT,  "mq_open errno ENOENT");
    203210
     
    212219  puts( "Init: mq_open - Open with too long of a name (ENAMETOOLONG)" );
    213220  n_mq2 = mq_open( Get_Too_Long_Name(), O_CREAT | O_RDONLY, 0x777, NULL );
    214   fatal_posix_service_pointer_minus_one(
    215     (void *) n_mq2, "mq_open error return status" );
     221  fatal_posix_mqd( n_mq2, "mq_open error return status" );
    216222  fatal_posix_service_status( errno, ENAMETOOLONG, "mq_open errno ENAMETOOLONG");
    217223
     
    232238  n_mq2 = mq_open(
    233239    Build_Queue_Name(0), O_CREAT | O_EXCL | O_RDONLY, 0x777, NULL);
    234   fatal_posix_service_pointer_minus_one(
    235     (void *) n_mq2, "mq_open error return status" );
     240  fatal_posix_mqd( n_mq2, "mq_open error return status" );
    236241  fatal_posix_service_status( errno, EEXIST,  "mq_open errno EEXIST");
    237242
     
    274279  puts( "Init: mq_open - system is out of resources (ENFILE)" );
    275280  n_mq2 = mq_open( Build_Queue_Name(i), O_CREAT | O_RDONLY, 0x777, NULL );
    276   fatal_posix_service_pointer_minus_one(
    277     (void *) n_mq2, "mq_open error return status" );
     281  fatal_posix_mqd( n_mq2, "mq_open error return status" );
    278282  fatal_posix_service_status( errno, ENFILE,  "mq_open errno ENFILE");
    279283
  • testsuites/psxtests/psxsem01/init.c

    r8ed7d0a r41909de  
    2222#include <pmacros.h>
    2323#include "test_support.h"
     24
     25#define fatal_posix_sem( _ptr, _msg ) \
     26  if ( (_ptr != SEM_FAILED) ) { \
     27    check_dispatch_disable_level( 0 ); \
     28    printf( "\n%s FAILED -- expected (-1) got (%p - %d/%s)\n", \
     29            (_msg), _ptr, errno, strerror(errno) ); \
     30    FLUSH_OUTPUT(); \
     31    rtems_test_exit( -1 ); \
     32  }
     33
    2434
    2535#define MAX_SEMS  10
     
    176186  puts( "Init: sem_open - UNSUCCESSFUL (ENAMETOOLONG)" );
    177187  n_sem1 = sem_open(Get_Too_Long_Name(), O_CREAT, 0777, 1 );
    178   fatal_posix_service_pointer_minus_one(
    179     n_sem1, "sem_open error return status");
     188  fatal_posix_sem( n_sem1, "sem_open error return status" );
    180189  fatal_posix_service_status(
    181190    errno, ENAMETOOLONG, "sem_open errorno ENAMETOOLONG" );
     
    192201  puts( "Init: sem_open - Create an Existing sem (EEXIST)" );
    193202  n_sem2 = sem_open("sem1", O_CREAT | O_EXCL, 0777, 1);
    194   fatal_posix_service_pointer_minus_one(
    195     n_sem2, "sem_open error return status" );
     203  fatal_posix_sem( n_sem2, "sem_open error return status" );
    196204  fatal_posix_service_status( errno, EEXIST,  "sem_open errno EEXIST");
    197205
    198206  puts( "Init: sem_open - Open new sem without create flag (ENOENT)" );
    199207  n_sem2 = sem_open("sem3", O_EXCL, 0777, 1);
    200   fatal_posix_service_pointer_minus_one(
    201     n_sem2, "sem_open error return status" );
     208  fatal_posix_sem( n_sem2, "sem_open error return status" );
    202209  fatal_posix_service_status( errno, ENOENT,  "sem_open errno EEXIST");
    203210
Note: See TracChangeset for help on using the changeset viewer.