Changeset 66c348cb in rtems


Ignore:
Timestamp:
Feb 1, 2008, 12:45:08 AM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
2186ba80
Parents:
81fed4b
Message:

2008-01-31 Joel Sherrill <joel.sherrill@…>

  • include/pmacros.h, psx01/init.c, psx01/system.h, psx13/main.c, psxbarrier01/main.c, psxchroot01/main.c, psxfatal_support/init.c, psxfile01/main.c, psxfile01/test.c, psxmount/main.c, psxrdwrv/main.c, psxreaddir/main.c, psxrwlock01/main.c, psxspin01/main.c, psxstat/main.c, psxtime/main.c: Change TEST_INIT to CONFIGURE_INIT. Make tmacros.h available to all POSIX tests. Add a clock_settime case for < 1988.
Location:
testsuites/psxtests
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r81fed4b r66c348cb  
     12008-01-31      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * include/pmacros.h, psx01/init.c, psx01/system.h, psx13/main.c,
     4        psxbarrier01/main.c, psxchroot01/main.c, psxfatal_support/init.c,
     5        psxfile01/main.c, psxfile01/test.c, psxmount/main.c, psxrdwrv/main.c,
     6        psxreaddir/main.c, psxrwlock01/main.c, psxspin01/main.c,
     7        psxstat/main.c, psxtime/main.c: Change TEST_INIT to CONFIGURE_INIT.
     8        Make tmacros.h available to all POSIX tests. Add a clock_settime case
     9        for < 1988.
     10
    1112008-01-31      Joel Sherrill <joel.sherrill@OARcorp.com>
    212
  • testsuites/psxtests/include/pmacros.h

    r81fed4b r66c348cb  
    1616#include <unistd.h>
    1717
     18#include <tmacros.h>
    1819#include <buffer_test_io.h>
    1920
     
    4344#define TM_DECEMBER   12
    4445
    45 #ifndef build_time
    46 #define build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \
     46#ifndef tm_build_time
     47#define tm_build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \
    4748  { (TM)->tm_year = YR;  \
    4849    (TM)->tm_mon  = MON; \
     
    6061    int status; \
    6162    \
    62     build_time( &tm, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ); \
     63    tm_build_time( &tm, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ); \
    6364    \
    6465    tv.tv_sec = mktime( &tm ); \
  • testsuites/psxtests/psx01/init.c

    r81fed4b r66c348cb  
    3333  puts( "\n\n*** POSIX TEST 1 ***" );
    3434
    35   build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
     35  tm_build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 );
    3636
    3737  /* print some system information */
     
    3939  puts( "Init: uname - EFAULT (invalid uts pointer argument)" );
    4040  status = uname( NULL );
    41   assert( status == -1 );
    42   assert( errno == EFAULT );
     41  rtems_test_assert( status == -1 );
     42  rtems_test_assert( errno == EFAULT );
    4343
    4444  status = uname( &uts );
    45   assert( !status );
     45  rtems_test_assert( !status );
    4646  printf( "Init: uts.sysname: %s\n", uts.sysname );
    4747  printf( "Init: uts.nodename: %s\n", uts.nodename );
     
    5555  puts( "Init: clock_gettime - EINVAL (NULL timespec)" );
    5656  status = clock_gettime( CLOCK_REALTIME, NULL );
    57   assert( status == -1 );
    58   assert( errno == EINVAL );
     57  rtems_test_assert( status == -1 );
     58  rtems_test_assert( errno == EINVAL );
    5959
    6060  puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
    6161  status = clock_gettime( -1, &tv );
    62   assert( status == -1 );
    63   assert( errno == EINVAL );
     62  rtems_test_assert( status == -1 );
     63  rtems_test_assert( errno == EINVAL );
    6464
    6565  puts( "Init: clock_settime - EINVAL (invalid clockid)" );
    6666  status = clock_settime( -1, &tv );
    67   assert( status == -1 );
    68   assert( errno == EINVAL );
     67  rtems_test_assert( status == -1 );
     68  rtems_test_assert( errno == EINVAL );
     69
     70  /* way back near the dawn of time :D */
     71  tv.tv_sec = 1;
     72  tv.tv_nsec = 0;
     73  printf( ctime( &tv.tv_sec ) );
     74  puts( "Init: clock_settime - before 1988 EINVAL" );
     75  status = clock_settime( CLOCK_REALTIME, &tv );
     76  rtems_test_assert( status == -1 );
     77  rtems_test_assert( errno == EINVAL );
    6978
    7079  /* exercise clock_getres */
     
    7281  puts( "Init: clock_getres - EINVAL (invalid clockid)" );
    7382  status = clock_getres( -1, &tv );
    74   assert( status == -1 );
    75   assert( errno == EINVAL );
     83  rtems_test_assert( status == -1 );
     84  rtems_test_assert( errno == EINVAL );
    7685
    7786  puts( "Init: clock_getres - EINVAL (NULL resolution)" );
    7887  status = clock_getres( CLOCK_REALTIME, NULL );
    79   assert( status == -1 );
    80   assert( errno == EINVAL );
     88  rtems_test_assert( status == -1 );
     89  rtems_test_assert( errno == EINVAL );
    8190
    8291  puts( "Init: clock_getres - SUCCESSFUL" );
    8392  status = clock_getres( CLOCK_REALTIME, &tv );
    8493  printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec );
    85   assert( !status );
     94  rtems_test_assert( !status );
    8695
    8796  /* set the time of day, and print our buffer in multiple ways */
    8897
    8998  tv.tv_sec = mktime( &tm );
    90   assert( tv.tv_sec != -1 );
     99  rtems_test_assert( tv.tv_sec != -1 );
    91100
    92101  tv.tv_nsec = 0;
     
    99108  puts( "Init: clock_settime - SUCCESSFUL" );
    100109  status = clock_settime( CLOCK_REALTIME, &tv );
    101   assert( !status );
     110  rtems_test_assert( !status );
    102111
    103112  printf( asctime( &tm ) );
     
    107116
    108117  remaining = sleep( 3 );
    109   assert( !remaining );
     118  rtems_test_assert( !remaining );
    110119 
    111120  /* print new times to make sure it has changed and we can get the realtime */
    112121  status = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv );
    113   assert( !status );
     122  rtems_test_assert( !status );
    114123  printf("Time since boot: (%d, %d)\n", tv.tv_sec,tv.tv_nsec );
    115124
    116125  status = clock_gettime( CLOCK_REALTIME, &tv );
    117   assert( !status );
     126  rtems_test_assert( !status );
    118127
    119128  printf( ctime( &tv.tv_sec ) );
     
    125134
    126135  seconds = time( &seconds1 );
    127   assert( seconds == seconds1 );
     136  rtems_test_assert( seconds == seconds1 );
    128137
    129138  /* check the time remaining */
    130139
    131140  printf( "Init: seconds remaining (%d)\n", (int)remaining );
    132   assert( !remaining );
     141  rtems_test_assert( !remaining );
    133142
    134143  /* error cases in nanosleep */
     
    137146  puts( "Init: nanosleep - EINVAL (NULL time)" );
    138147  status = nanosleep ( NULL, &tr );
    139   assert( status == -1 );
    140   assert( errno == EINVAL );
     148  rtems_test_assert( status == -1 );
     149  rtems_test_assert( errno == EINVAL );
    141150
    142151  tv.tv_sec = 0;
     
    144153  puts( "Init: nanosleep - EINVAL (too many nanoseconds)" );
    145154  status = nanosleep ( &tv, &tr );
    146   assert( status == -1 );
    147   assert( errno == EINVAL );
     155  rtems_test_assert( status == -1 );
     156  rtems_test_assert( errno == EINVAL );
    148157
    149158  /* this is actually a small delay or yield */
     
    152161  puts( "Init: nanosleep - negative seconds small delay " );
    153162  status = nanosleep ( &tv, &tr );
    154   assert( status == -1 );
    155   assert( errno == EINVAL );
     163  rtems_test_assert( status == -1 );
     164  rtems_test_assert( errno == EINVAL );
    156165
    157166  /* use nanosleep to yield */
     
    162171  puts( "Init: nanosleep - yield" );
    163172  status = nanosleep ( &tv, &tr );
    164   assert( !status );
    165   assert( !tr.tv_sec );
    166   assert( !tr.tv_nsec );
     173  rtems_test_assert( !status );
     174  rtems_test_assert( !tr.tv_sec );
     175  rtems_test_assert( !tr.tv_nsec );
    167176
    168177  /* use nanosleep to delay */
     
    173182  puts( "Init: nanosleep - 1.05 seconds" );
    174183  status = nanosleep ( &tv, &tr );
    175   assert( !status );
     184  rtems_test_assert( !status );
    176185
    177186  /* print the current real time again */
    178187  status = clock_gettime( CLOCK_REALTIME, &tv );
    179   assert( !status );
     188  rtems_test_assert( !status );
    180189  printf( ctime( &tv.tv_sec ) );
    181190
     
    183192
    184193  printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec );
    185   assert( !tr.tv_sec && !tr.tv_nsec );
     194  rtems_test_assert( !tr.tv_sec && !tr.tv_nsec );
    186195
    187196  puts( "Init: usleep - 1.35 seconds" );
    188197  useconds = usleep ( 1350000 );
    189   assert( useconds < 1350000);
     198  rtems_test_assert( useconds < 1350000);
    190199 
    191200  /* print the current real time again */
    192201  status = clock_gettime( CLOCK_REALTIME, &tv );
    193   assert( !status );
     202  rtems_test_assert( !status );
    194203  printf( ctime( &tv.tv_sec ) );
    195204
     
    203212  priority = sched_get_priority_min( SCHED_FIFO );
    204213  printf( "Init: sched_get_priority_min (SCHED_FIFO) -- %d\n", priority );
    205   assert( priority != -1 );
     214  rtems_test_assert( priority != -1 );
    206215
    207216  puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" );
    208217  priority = sched_get_priority_min( -1 );
    209   assert( priority == -1 );
    210   assert( errno == EINVAL );
     218  rtems_test_assert( priority == -1 );
     219  rtems_test_assert( errno == EINVAL );
    211220
    212221  /* exercise get maximum priority */
     
    214223  priority = sched_get_priority_max( SCHED_FIFO );
    215224  printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority );
    216   assert( priority != -1 );
     225  rtems_test_assert( priority != -1 );
    217226
    218227  puts( "Init: sched_get_priority_max -- EINVAL (invalid policy)" );
    219228  priority = sched_get_priority_max( -1 );
    220   assert( priority == -1 );
    221   assert( errno == EINVAL );
     229  rtems_test_assert( priority == -1 );
     230  rtems_test_assert( errno == EINVAL );
    222231
    223232  puts( "Init: sched_rr_get_interval -- ESRCH (invalid PID)" );
    224233  status = sched_rr_get_interval( 4, &tr );
    225   assert( status == -1 );
    226   assert( errno == ESRCH );
     234  rtems_test_assert( status == -1 );
     235  rtems_test_assert( errno == ESRCH );
    227236 
    228237  puts( "Init: sched_rr_get_interval -- EINVAL (invalid interval pointer)" );
    229238  status = sched_rr_get_interval( getpid(), NULL );
    230   assert( status == -1 );
    231   assert( errno == EINVAL );
     239  rtems_test_assert( status == -1 );
     240  rtems_test_assert( errno == EINVAL );
    232241 
    233242  /* print the round robin time quantum */
     
    239248    tr.tv_nsec
    240249  );
    241   assert( !status );
     250  rtems_test_assert( !status );
    242251
    243252  /* create a thread */
     
    245254  puts( "Init: pthread_create - SUCCESSFUL" );
    246255  status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL );
    247   assert( !status );
     256  rtems_test_assert( !status );
    248257
    249258  /* too may threads error */
     
    251260  puts( "Init: pthread_create - EAGAIN (too many threads)" );
    252261  status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL );
    253   assert( status == EAGAIN );
     262  rtems_test_assert( status == EAGAIN );
    254263
    255264  puts( "Init: sched_yield to Task_1" );
    256265  status = sched_yield();
    257   assert( !status );
     266  rtems_test_assert( !status );
    258267
    259268    /* switch to Task_1 */
  • testsuites/psxtests/psx01/system.h

    r81fed4b r66c348cb  
    4242/* global variables */
    4343
    44 #ifdef CONFIGURE_INIT
    45 #define TEST_EXTERN
    46 #else
    47 #define TEST_EXTERN extern
    48 #endif
    49 
    5044TEST_EXTERN pthread_t        Init_id;
    5145TEST_EXTERN pthread_t        Task_id;
  • testsuites/psxtests/psx13/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxbarrier01/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxchroot01/main.c

    r81fed4b r66c348cb  
    33 */
    44
    5 #define TEST_INIT
     5#define CONFIGURE_INIT
    66
    77#include <bsp.h>
  • testsuites/psxtests/psxfatal_support/init.c

    r81fed4b r66c348cb  
    2222 */
    2323
    24 #define TEST_INIT
     24#define CONFIGURE_INIT
    2525#include "system.h"
    2626
  • testsuites/psxtests/psxfile01/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxfile01/test.c

    r81fed4b r66c348cb  
    2323#include <stdio.h>
    2424
    25 #include <tmacros.h>
     25#include <pmacros.h>
    2626#include <sys/types.h>
    2727#include <sys/stat.h>
  • testsuites/psxtests/psxmount/main.c

    r81fed4b r66c348cb  
    55 */
    66
    7 #define TEST_INIT
     7#define CONFIGURE_INIT
    88
    99#include <bsp.h>
  • testsuites/psxtests/psxrdwrv/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxreaddir/main.c

    r81fed4b r66c348cb  
    33 */
    44
    5 #define TEST_INIT
     5#define CONFIGURE_INIT
    66
    77#include <bsp.h>
  • testsuites/psxtests/psxrwlock01/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxspin01/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxstat/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
  • testsuites/psxtests/psxtime/main.c

    r81fed4b r66c348cb  
    1212 */
    1313
    14 #define TEST_INIT
     14#define CONFIGURE_INIT
    1515
    1616#include <bsp.h>
Note: See TracChangeset for help on using the changeset viewer.