Changeset ea7d86b in rtems


Ignore:
Timestamp:
Nov 12, 2009, 12:21:51 AM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
3a6f4e2
Parents:
0c11618
Message:

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

PR 1466/tests

  • Makefile.am, configure.ac, psxclock/init.c, psxclock/psxclock.doc, psxclock/psxclock.scn, psxkey03/init.c, psxsignal02/init.c, psxsignal03/init.c, psxstack01/init.c: Remove usleep() from tests. Add test specifically to test it since it is deprecated as of POSIX.1-2008.
  • psxusleep/.cvsignore, psxusleep/Makefile.am, psxusleep/init.c, psxusleep/psxusleep.doc, psxusleep/psxusleep.scn: New files.
Location:
testsuites/psxtests
Files:
5 added
10 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r0c11618 rea7d86b  
     12009-11-11      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        PR 1466/tests
     4        * Makefile.am, configure.ac, psxclock/init.c, psxclock/psxclock.doc,
     5        psxclock/psxclock.scn, psxkey03/init.c, psxsignal02/init.c,
     6        psxsignal03/init.c, psxstack01/init.c: Remove usleep() from tests.
     7        Add test specifically to test it since it is deprecated as of
     8        POSIX.1-2008.
     9        * psxusleep/.cvsignore, psxusleep/Makefile.am, psxusleep/init.c,
     10        psxusleep/psxusleep.doc, psxusleep/psxusleep.scn: New files.
     11
    1122009-11-09      Joel Sherrill <joel.sherrill@oarcorp.com>
    213
  • testsuites/psxtests/Makefile.am

    r0c11618 rea7d86b  
    1515    psxmutexattr01 psxobj01 psxrwlock01 psxsem01 psxsignal01 psxsignal02 \
    1616    psxsignal03 psxsignal04 psxsignal05 psxspin01 psxspin02 psxsysconf \
    17     psxtime psxtimer01 psxtimer02 psxualarm psxfatal01 psxfatal02 \
     17    psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
    1818    psxintrcritical01 psxstack01
    1919endif
  • testsuites/psxtests/configure.ac

    r0c11618 rea7d86b  
    116116psxtimer02/Makefile
    117117psxualarm/Makefile
     118psxusleep/Makefile
    118119])
    119120AC_OUTPUT
  • testsuites/psxtests/psxclock/init.c

    r0c11618 rea7d86b  
    3535  unsigned int    remaining;
    3636  struct tm       tm;
    37   useconds_t      useconds;
     37  struct timespec delay_request;
    3838
    3939  puts( "\n\n*** POSIX CLOCK TEST ***" );
     
    207207  rtems_test_assert( !tr.tv_sec && !tr.tv_nsec );
    208208
    209   puts( "Init: usleep - 1.35 seconds" );
    210   useconds = usleep ( 1350000 );
    211   rtems_test_assert( useconds < 1350000 );
     209  puts( "Init: nanosleep - 1.35 seconds" );
     210  delay_request.tv_sec = 1;
     211  delay_request.tv_nsec = 35000000;
     212  sc = nanosleep( &delay_request, NULL );
     213  assert( !sc );
    212214 
    213215  /* print the current real time again */
  • testsuites/psxtests/psxclock/psxclock.scn

    r0c11618 rea7d86b  
    2929Fri May 24 11:05:06 1996
    3030Init: sec (0), nsec (0) remaining
    31 Init: usleep - 1.35 seconds
     31Init: nanosleep - 1.35 seconds
    3232Fri May 24 11:05:07 1996
    3333clock_gettime - CLOCK_THREAD_CPUTIME -- ENOSYS
  • testsuites/psxtests/psxkey03/init.c

    r0c11618 rea7d86b  
    4141)
    4242{
    43   pthread_t     thread;
    44   int           sc;
     43  pthread_t        thread;
     44  int              sc;
     45  struct timespec  delay_request;
    4546
    4647  puts( "\n\n*** TEST KEY 03 ***" );
     
    5859
    5960  puts( "Init - sleep - let thread run - OK" );
    60   usleep(500000);
     61  delay_request.tv_sec = 0;
     62  delay_request.tv_nsec = 5 * 100000000;
     63  sc = nanosleep( &delay_request, NULL );
     64  assert( !sc );
    6165
    6266  puts( "Init - pthread_key_delete - OK" );
     
    7781
    7882  puts( "Init - sleep - let thread run - OK" );
    79   usleep(500000);
     83  sc = nanosleep( &delay_request, NULL );
     84  assert( !sc );
    8085
    8186  puts( "Init - verify destructor did NOT ran" );
  • testsuites/psxtests/psxsignal02/init.c

    r0c11618 rea7d86b  
    126126  Test_t             *test;
    127127  struct sigaction    act;
     128  struct timespec     delay_request;
    128129
    129130  puts( "\n\n*** POSIX TEST SIGNAL 02 ***" );
     
    162163
    163164    puts( "Init - sleep - let thread settle - OK" );
    164     usleep(500000);
     165    delay_request.tv_sec = 0;
     166    delay_request.tv_nsec = 50000000;
     167    sc = nanosleep( &delay_request, NULL );
     168    assert( !sc );
    165169  }
    166170
  • testsuites/psxtests/psxsignal03/init.c

    r0c11618 rea7d86b  
    149149  bool                trueArg = true;
    150150  bool                falseArg = false;
     151  struct timespec     delay_request;
    151152
    152153  puts( "\n\n*** POSIX TEST SIGNAL " TEST_NAME " ***" );
     
    169170
    170171  puts( "Init - sleep - let threads settle - OK" );
    171   usleep(500000);
     172  delay_request.tv_sec = 0;
     173  delay_request.tv_nsec = 5 * 100000000;
     174  sc = nanosleep( &delay_request, NULL );
     175  assert( !sc );
    172176
    173177  puts( "Init - sleep - SignalBlocked thread settle - OK" );
    174   usleep(500000);
     178  sc = nanosleep( &delay_request, NULL );
     179  assert( !sc );
    175180
    176181  printf( "Init - sending %s - deliver to one thread\n",
  • testsuites/psxtests/psxstack01/init.c

    r0c11618 rea7d86b  
    5050  pthread_t           id;
    5151  pthread_attr_t      attr;
     52  struct timespec     delay_request;
    5253
    5354  puts( "\n\n*** POSIX STACK ATTRIBUTE TEST 01 ***" );
     
    7374
    7475  puts( "Init - let other thread run" );
    75   usleep( 500000 );
     76  delay_request.tv_sec = 0;
     77  delay_request.tv_nsec = 5 * 100000000;
     78  sc = nanosleep( &delay_request, NULL );
     79  assert( !sc );
    7680
    7781  puts( "*** END OF POSIX STACK ATTRIBUTE TEST 01 ***" );
Note: See TracChangeset for help on using the changeset viewer.