Changeset 1e2d7510 in rtems


Ignore:
Timestamp:
Sep 14, 2009, 12:15:55 AM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
7c411bd
Parents:
e7de563a
Message:

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

  • psxclock/init.c, psxclock/psxclock.scn, psxenosys/init.c, psxenosys/psxenosys.scn, psxsignal03/Makefile.am, psxsignal03/init.c, psxsignal04/Makefile.am: Move test cases which needed to be executed when POSIX is disabled to psxclock so they will be.
Location:
testsuites/psxtests
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    re7de563a r1e2d7510  
     12009-09-13      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * psxclock/init.c, psxclock/psxclock.scn, psxenosys/init.c,
     4        psxenosys/psxenosys.scn, psxsignal03/Makefile.am, psxsignal03/init.c,
     5        psxsignal04/Makefile.am: Move test cases which needed to be executed
     6        when POSIX is disabled to psxclock so they will be.
     7
    182009-09-13      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • testsuites/psxtests/psxclock/init.c

    re7de563a r1e2d7510  
    1414#include <errno.h>
    1515
     16void check_enosys(int status);
     17
     18void check_enosys(int status)
     19{
     20  if ( (status == -1) && (errno == ENOSYS) )
     21    return;
     22  puts( "ERROR -- did not return ENOSYS as expected" );
     23  rtems_test_exit(0);
     24}
     25
    1626rtems_task Init(
    1727  rtems_task_argument argument
     
    2030  struct timespec tv;
    2131  struct timespec tr;
    22   int             status;
     32  int             sc;
    2333  int             priority;
    2434  pthread_t       thread_id;
     
    3646
    3747  puts( "Init: clock_gettime - EINVAL (NULL timespec)" );
    38   status = clock_gettime( CLOCK_REALTIME, NULL );
    39   rtems_test_assert( status == -1 );
     48  sc = clock_gettime( CLOCK_REALTIME, NULL );
     49  rtems_test_assert( sc == -1 );
    4050  rtems_test_assert( errno == EINVAL );
    4151
    4252  puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
    43   status = clock_gettime( (clockid_t)-1, &tv );
    44   rtems_test_assert( status == -1 );
     53  sc = clock_gettime( (clockid_t)-1, &tv );
     54  rtems_test_assert( sc == -1 );
    4555  rtems_test_assert( errno == EINVAL );
    4656
    4757  puts( "Init: clock_settime - EINVAL (invalid clockid)" );
    48   status = clock_settime( (clockid_t)-1, &tv );
    49   rtems_test_assert( status == -1 );
     58  sc = clock_settime( (clockid_t)-1, &tv );
     59  rtems_test_assert( sc == -1 );
    5060  rtems_test_assert( errno == EINVAL );
    5161
     
    5565  printf( ctime( &tv.tv_sec ) );
    5666  puts( "Init: clock_settime - before 1988 EINVAL" );
    57   status = clock_settime( CLOCK_REALTIME, &tv );
    58   rtems_test_assert( status == -1 );
     67  sc = clock_settime( CLOCK_REALTIME, &tv );
     68  rtems_test_assert( sc == -1 );
    5969  rtems_test_assert( errno == EINVAL );
    6070
     
    6272
    6373  puts( "Init: clock_getres - EINVAL (invalid clockid)" );
    64   status = clock_getres( (clockid_t) -1, &tv );
    65   rtems_test_assert( status == -1 );
     74  sc = clock_getres( (clockid_t) -1, &tv );
     75  rtems_test_assert( sc == -1 );
    6676  rtems_test_assert( errno == EINVAL );
    6777
    6878  puts( "Init: clock_getres - EINVAL (NULL resolution)" );
    69   status = clock_getres( CLOCK_REALTIME, NULL );
    70   rtems_test_assert( status == -1 );
     79  sc = clock_getres( CLOCK_REALTIME, NULL );
     80  rtems_test_assert( sc == -1 );
    7181  rtems_test_assert( errno == EINVAL );
    7282
    7383  puts( "Init: clock_getres - SUCCESSFUL" );
    74   status = clock_getres( CLOCK_REALTIME, &tv );
     84  sc = clock_getres( CLOCK_REALTIME, &tv );
    7585  printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec );
    76   rtems_test_assert( !status );
     86  rtems_test_assert( !sc );
    7787
    7888  /* set the time of day, and print our buffer in multiple ways */
     
    8999  printf( asctime( &tm ) );
    90100  puts( "Init: clock_settime - SUCCESSFUL" );
    91   status = clock_settime( CLOCK_REALTIME, &tv );
    92   rtems_test_assert( !status );
     101  sc = clock_settime( CLOCK_REALTIME, &tv );
     102  rtems_test_assert( !sc );
    93103
    94104  printf( asctime( &tm ) );
     
    101111 
    102112  /* print new times to make sure it has changed and we can get the realtime */
    103   status = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv );
    104   rtems_test_assert( !status );
     113  sc = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv );
     114  rtems_test_assert( !sc );
    105115  printf("Time since boot: (%d, %d)\n", tv.tv_sec,tv.tv_nsec );
    106116
    107   status = clock_gettime( CLOCK_REALTIME, &tv );
    108   rtems_test_assert( !status );
     117  sc = clock_gettime( CLOCK_REALTIME, &tv );
     118  rtems_test_assert( !sc );
    109119
    110120  printf( ctime( &tv.tv_sec ) );
     
    127137  empty_line();
    128138  puts( "Init: nanosleep - EINVAL (NULL time)" );
    129   status = nanosleep ( NULL, &tr );
    130   rtems_test_assert( status == -1 );
     139  sc = nanosleep ( NULL, &tr );
     140  rtems_test_assert( sc == -1 );
    131141  rtems_test_assert( errno == EINVAL );
    132142
     
    134144  tv.tv_nsec = TOD_NANOSECONDS_PER_SECOND * 2;
    135145  puts( "Init: nanosleep - EINVAL (too many nanoseconds)" );
    136   status = nanosleep ( &tv, &tr );
    137   rtems_test_assert( status == -1 );
     146  sc = nanosleep ( &tv, &tr );
     147  rtems_test_assert( sc == -1 );
    138148  rtems_test_assert( errno == EINVAL );
    139149
     
    142152  tv.tv_nsec = 0;
    143153  puts( "Init: nanosleep - negative seconds small delay " );
    144   status = nanosleep ( &tv, &tr );
    145   rtems_test_assert( status == -1 );
     154  sc = nanosleep ( &tv, &tr );
     155  rtems_test_assert( sc == -1 );
    146156  rtems_test_assert( errno == EINVAL );
    147157
     
    152162
    153163  puts( "Init: nanosleep - yield with remaining" );
    154   status = nanosleep ( &tv, &tr );
    155   rtems_test_assert( !status );
     164  sc = nanosleep ( &tv, &tr );
     165  rtems_test_assert( !sc );
    156166  rtems_test_assert( !tr.tv_sec );
    157167  rtems_test_assert( !tr.tv_nsec );
    158168
    159169  puts( "Init: nanosleep - yield with NULL time remaining" );
    160   status = nanosleep ( &tv, NULL );
    161   rtems_test_assert( !status );
     170  sc = nanosleep ( &tv, NULL );
     171  rtems_test_assert( !sc );
    162172  rtems_test_assert( !tr.tv_sec );
    163173  rtems_test_assert( !tr.tv_nsec );
     
    169179
    170180  puts( "Init: nanosleep - 1.05 seconds" );
    171   status = nanosleep ( &tv, &tr );
    172   rtems_test_assert( !status );
     181  sc = nanosleep ( &tv, &tr );
     182  rtems_test_assert( !sc );
    173183
    174184  /* print the current real time again */
    175   status = clock_gettime( CLOCK_REALTIME, &tv );
    176   rtems_test_assert( !status );
     185  sc = clock_gettime( CLOCK_REALTIME, &tv );
     186  rtems_test_assert( !sc );
    177187  printf( ctime( &tv.tv_sec ) );
    178188
     
    187197 
    188198  /* print the current real time again */
    189   status = clock_gettime( CLOCK_REALTIME, &tv );
    190   rtems_test_assert( !status );
    191   printf( ctime( &tv.tv_sec ) );
     199  sc = clock_gettime( CLOCK_REALTIME, &tv );
     200  rtems_test_assert( !sc );
     201  printf( ctime( &tv.tv_sec ) );
     202
     203  puts( "" );
     204  puts( "clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS" );
     205  #if defined(_POSIX_THREAD_CPUTIME)
     206    {
     207      struct timespec tp;
     208      sc = clock_gettime( CLOCK_THREAD_CPUTIME, &tp );
     209      check_enosys( sc );
     210    }
     211  #endif
     212
     213  puts( "clock_settime - CLOCK_PROCESS_CPUTIME -- ENOSYS" );
     214  #if defined(_POSIX_CPUTIME)
     215    {
     216      struct timespec tp;
     217      sc = clock_settime( CLOCK_PROCESS_CPUTIME, &tp );
     218      check_enosys( sc );
     219    }
     220  #endif
     221
     222  puts( "clock_settime - CLOCK_THREAD_CPUTIME -- ENOSYS" );
     223  #if defined(_POSIX_THREAD_CPUTIME)
     224    {
     225      struct timespec tp;
     226      sc = clock_settime( CLOCK_THREAD_CPUTIME, &tp );
     227      check_enosys( sc );
     228    }
     229  #endif
    192230
    193231  puts( "*** END OF POSIX CLOCK TEST ***" );
  • testsuites/psxtests/psxclock/psxclock.scn

    re7de563a r1e2d7510  
    2929Init: usleep - 1.35 seconds
    3030Fri May 24 11:05:07 1996
     31clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS
     32clock_settime - CLOCK_PROCESS_CPUTIME -- ENOSYS
     33clock_settime - CLOCK_THREAD_CPUTIME -- ENOSYS
    3134*** END OF POSIX CLOCK TEST ***
  • testsuites/psxtests/psxenosys/init.c

    re7de563a r1e2d7510  
    8383  check_enosys( sc );
    8484
    85   puts( "clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS" );
    86   #if defined(_POSIX_THREAD_CPUTIME)
    87     {
    88       struct timespec tp;
    89       sc = clock_gettime( CLOCK_THREAD_CPUTIME, &tp );
    90       check_enosys( sc );
    91     }
    92   #endif
    93 
    94   puts( "clock_settime - CLOCK_PROCESS_CPUTIME -- ENOSYS" );
    95   #if defined(_POSIX_CPUTIME)
    96     {
    97       struct timespec tp;
    98       sc = clock_settime( CLOCK_PROCESS_CPUTIME, &tp );
    99       check_enosys( sc );
    100     }
    101   #endif
    102 
    103   puts( "clock_settime - CLOCK_THREAD_CPUTIME -- ENOSYS" );
    104   #if defined(_POSIX_THREAD_CPUTIME)
    105     {
    106       struct timespec tp;
    107       sc = clock_settime( CLOCK_THREAD_CPUTIME, &tp );
    108       check_enosys( sc );
    109     }
    110   #endif
    111 
    11285  puts( "devctl -- ENOSYS" );
    11386  sc = devctl( 0, NULL, 0, NULL );
  • testsuites/psxtests/psxenosys/psxenosys.scn

    re7de563a r1e2d7510  
    1111clock_getenable_attr -- ENOSYS
    1212clock_setenable_attr -- ENOSYS
    13 clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS
    14 clock_settime - CLOCK_PROCESS_CPUTIME -- ENOSYS
    15 clock_settime - CLOCK_THREAD_CPUTIME -- ENOSYS
    1613devctl -- ENOSYS
    1714execl -- ENOSYS
  • testsuites/psxtests/psxsignal03/Makefile.am

    re7de563a r1e2d7510  
    1919AM_CPPFLAGS += -I$(top_srcdir)/include
    2020AM_CPPFLAGS += -I$(top_srcdir)/../support/include
    21 AM_CPPFLAGS += -DUSE_USER_SIGNALS
     21AM_CPPFLAGS += -DUSE_USER_SIGNALS_PROCESS
    2222
    2323LINK_OBJS = $(psxsignal03_OBJECTS) $(psxsignal03_LDADD)
  • testsuites/psxtests/psxsignal03/init.c

    re7de563a r1e2d7510  
    1010 */
    1111
    12 #if defined(USE_USER_SIGNALS)
     12#if defined(USE_USER_SIGNALS_PROCESS)
    1313  #define TEST_NAME                "03"
    14   #define TEST_STRING              "User Signals"
     14  #define TEST_STRING              "User Signals to Process"
    1515  #define SIGNAL_ONE               SIGUSR1
    1616  #define SIGNAL_TWO               SIGUSR2
    17 
    18 #elif defined(USE_REAL_TIME_SIGNALS)
     17  #define SEND_SIGNAL(_sig)        kill( getpid(), _sig )
     18  #define TO_PROCESS
     19
     20#elif defined(USE_REAL_TIME_SIGNALS_PROCESS)
    1921  #define TEST_NAME                "04"
    20   #define TEST_STRING              "Real-Time Signals"
     22  #define TEST_STRING              "Real-Time Signals to Process"
    2123  #define SIGNAL_ONE               SIGRTMIN
    2224  #define SIGNAL_TWO               SIGRTMAX
     25  #define SEND_SIGNAL(_sig)        kill( getpid(), _sig )
     26  #define TO_PROCESS
     27
     28#elif defined(USE_USER_SIGNALS_THREAD)
     29  #define TEST_NAME                "05"
     30  #define TEST_STRING              "User Signals to Thread"
     31  #define SIGNAL_ONE               SIGUSR1
     32  #define SIGNAL_TWO               SIGUSR2
     33  #define SEND_SIGNAL(_sig)        pthread_kill( id, _sig )
     34  #define TO_THREAD
     35
     36#elif defined(USE_REAL_TIME_SIGNALS_THREAD)
     37  #define TEST_NAME                "05"
     38  #define TEST_STRING              "Real-Time Signals to Thread"
     39  #define SIGNAL_ONE               SIGRTMIN
     40  #define SIGNAL_TWO               SIGRTMAX
     41  #define SEND_SIGNAL(_sig)        pthread_kill( id, _sig )
     42  #define TO_THREAD
    2343
    2444#else
     
    155175  printf( "Init - sending %s - deliver to one thread\n",
    156176          signal_name(SIGNAL_TWO));
    157   sc =  kill( getpid(), SIGNAL_TWO );
     177  sc =  SEND_SIGNAL( SIGNAL_TWO );
    158178  assert( !sc );
    159179
    160180  printf( "Init - sending %s - deliver to other thread\n",
    161181          signal_name(SIGNAL_TWO));
    162   sc =  kill( getpid(), SIGNAL_TWO );
    163   assert( !sc );
    164 
    165   printf( "Init - sending %s - expect EAGAIN\n", signal_name(SIGNAL_TWO) );
    166   sc =  kill( getpid(), SIGNAL_TWO );
    167   assert( sc == -1 );
    168   assert( errno == EAGAIN );
     182  sc =  SEND_SIGNAL( SIGNAL_TWO );
     183  assert( !sc );
     184
     185  #if defined(TO_PROCESS)
     186    printf( "Init - sending %s - expect EAGAIN\n", signal_name(SIGNAL_TWO) );
     187    sc =  SEND_SIGNAL( SIGNAL_TWO );
     188    assert( sc == -1 );
     189    assert( errno == EAGAIN );
     190  #endif
    169191
    170192  puts( "Init - sleep - let thread report if it unblocked - OK" );
  • testsuites/psxtests/psxsignal04/Makefile.am

    re7de563a r1e2d7510  
    1919AM_CPPFLAGS += -I$(top_srcdir)/include
    2020AM_CPPFLAGS += -I$(top_srcdir)/../support/include
    21 AM_CPPFLAGS += -DUSE_REAL_TIME_SIGNALS
     21AM_CPPFLAGS += -DUSE_REAL_TIME_SIGNALS_PROCESS
    2222
    2323LINK_OBJS = $(psxsignal04_OBJECTS) $(psxsignal04_LDADD)
Note: See TracChangeset for help on using the changeset viewer.