Changeset 89b897f0 in rtems for testsuites/psxtests


Ignore:
Timestamp:
Jun 28, 2010, 9:00:15 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
1d33ecab
Parents:
ef87186
Message:

2010-06-28 Joel Sherrill <joel.sherrill@…>

  • psxtime/psxtime.scn, psxtime/test.c: Add test for passing a null pointer.
Location:
testsuites/psxtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    ref87186 r89b897f0  
     12010-06-28      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * psxtime/psxtime.scn, psxtime/test.c: Add test for passing a null
     4        pointer.
     5
    162010-06-28      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • testsuites/psxtests/psxtime/psxtime.scn

    ref87186 r89b897f0  
    11*** POSIX TIME OF DAY TEST ***
     2gettimeofday( NULL, NULL ) - EFAULT
    23rtems_clock_set          12:45:00   01/01/1988
    34adjtime - NULL delta - EINVAL
  • testsuites/psxtests/psxtime/test.c

    ref87186 r89b897f0  
    6767  print_time( "rtems_clock_set          ", the_tod, "\n" );
    6868  status = rtems_clock_set( the_tod );
    69   rtems_test_assert(  !status );
     69  rtems_test_assert( !status );
    7070
    7171  do {
    7272    status = rtems_clock_get_tod( &new_tod );
    73     rtems_test_assert(  !status );
     73    rtems_test_assert( !status );
    7474    print_time( "rtems_clock_get_tod          ", &new_tod, "\n" );
    7575
    7676    /* now do the posix time gets */
    7777    result = gettimeofday( &tv, 0 );
    78     rtems_test_assert(  result == 0 );
     78    rtems_test_assert( result == 0 );
    7979    a_time_t = tv.tv_sec;   /* ctime() takes a time_t */
    8080    printf( "gettimeofday: %s", ctime( &a_time_t) );
     
    110110  print_time( "rtems_clock_set          ", the_tod, "\n" );
    111111  status = rtems_clock_set( the_tod );
    112   rtems_test_assert(  !status );
     112  rtems_test_assert( !status );
    113113
    114114  delta.tv_sec = 0;
     
    119119  puts( "adjtime - NULL delta - EINVAL" );
    120120  sc = adjtime( NULL, &olddelta );
    121   rtems_test_assert(  sc == -1 );
    122   rtems_test_assert(  errno == EINVAL );
     121  rtems_test_assert( sc == -1 );
     122  rtems_test_assert( errno == EINVAL );
    123123
    124124  puts( "adjtime - delta out of range - EINVAL" );
    125125  delta.tv_usec = 1000000000; /* 100 seconds worth */
    126126  sc = adjtime( &delta, &olddelta );
    127   rtems_test_assert(  sc == -1 );
    128   rtems_test_assert(  errno == EINVAL );
     127  rtems_test_assert( sc == -1 );
     128  rtems_test_assert( errno == EINVAL );
    129129
    130130  puts( "adjtime - delta too small - do nothing" );
     
    132132  delta.tv_usec = 1;
    133133  sc = adjtime( &delta, &olddelta );
    134   rtems_test_assert(  sc == 0 );
     134  rtems_test_assert( sc == 0 );
    135135
    136136  puts( "adjtime - delta too small - do nothing, olddelta=NULL" );
    137137  sc = adjtime( &delta, NULL );
    138   rtems_test_assert(  sc == 0 );
     138  rtems_test_assert( sc == 0 );
    139139
    140140  puts( "adjtime - delta of one second forward, olddelta=NULL" );
     
    142142  delta.tv_usec = 0;
    143143  sc = adjtime( &delta, NULL );
    144   rtems_test_assert(  sc == 0 );
     144  rtems_test_assert( sc == 0 );
    145145
    146146  puts( "adjtime - delta of one second forward" );
     
    148148  delta.tv_usec = 0;
    149149  sc = adjtime( &delta, &olddelta );
    150   rtems_test_assert(  sc == 0 );
     150  rtems_test_assert( sc == 0 );
    151151
    152152  puts( "adjtime - delta of almost two seconds forward" );
     
    154154  delta.tv_usec = 1000000 - 1;
    155155  sc = adjtime( &delta, &olddelta );
    156   rtems_test_assert(  sc == 0 );
     156  rtems_test_assert( sc == 0 );
    157157
    158158  /*
     
    160160   */
    161161  ticks = rtems_clock_get_ticks_per_second();
    162   rtems_test_assert(  ticks );
     162  rtems_test_assert( ticks );
    163163  ticks /= 2;
    164164  do {
    165165    status = rtems_clock_get_tod( &tod );
    166     rtems_test_assert(  !status );
     166    rtems_test_assert( !status );
    167167  } while ( tod.ticks <= ticks );
    168168
     
    171171  delta.tv_usec = 1000000 - 1;
    172172  sc = adjtime( &delta, &olddelta );
    173   rtems_test_assert(  sc == 0 );
     173  rtems_test_assert( sc == 0 );
    174174
    175175  status = rtems_clock_get_tod( &tod );
    176   rtems_test_assert(  !status );
     176  rtems_test_assert( !status );
    177177  print_time( "rtems_clock_get_tod          ", &tod, "\n" );
    178178}
     
    194194{
    195195  int i;
     196  int sc;
    196197
    197198  puts( "\n\n*** POSIX TIME OF DAY TEST ***" );
     199
     200  puts( "gettimeofday( NULL, NULL ) - EFAULT" );
     201  sc = gettimeofday( NULL, NULL );
     202  rtems_test_assert( sc == -1 );
     203  rtems_test_assert( errno == EFAULT );
    198204
    199205  test_adjtime();
Note: See TracChangeset for help on using the changeset viewer.