Changeset 1369978 in rtems for testsuites/support


Ignore:
Timestamp:
Nov 9, 2009, 2:49:35 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
86436f44
Parents:
96bdacd
Message:

2009-11-09 Joel Sherrill <joel.sherrill@…>

  • support/include/tmacros.h: Add service to check status returned by POSIX methods which return a pointer which is -1 on error. This eliminated some casts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/support/include/tmacros.h

    r96bdacd r1369978  
    9393
    9494#define posix_service_failed( _dirstat, _failmsg )  \
    95  fatal_posix_service_status( _dirstat, RTEMS_SUCCESSFUL, _failmsg )
     95 fatal_posix_service_status( _dirstat, 0, _failmsg )
    9696
    9797#define posix_service_failed_with_level( _dirstat, _failmsg, _level )  \
    98  fatal_posix_service_status_with_level( \
    99       _dirstat, RTEMS_SUCCESSFUL, _failmsg, _level )
     98 fatal_posix_service_status_with_level( _dirstat, 0, _failmsg, _level )
    10099
    101100#define fatal_posix_service_status_errno( _stat, _desired, _msg ) \
     
    112111#define fatal_posix_service_status( _stat, _desired, _msg ) \
    113112  fatal_posix_service_status_with_level( _stat, _desired, _msg, 0 )
     113
     114#define fatal_posix_service_pointer_minus_one( _ptr, _msg ) \
     115  if ( (_ptr != (void *)-1) ) { \
     116    check_dispatch_disable_level( 0 ); \
     117    printf( "\n%s FAILED -- expected (-1) got (%p - %d/%s)\n", \
     118            (_msg), _ptr, errno, strerror(errno) ); \
     119    FLUSH_OUTPUT(); \
     120    rtems_test_exit( -1 ); \
     121  }
    114122
    115123#define fatal_posix_service_status_with_level( _stat, _desired, _msg, _level ) \
Note: See TracChangeset for help on using the changeset viewer.