Changeset 1750f5a6 in rtems


Ignore:
Timestamp:
Jul 24, 2008, 8:43:58 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
9b4f75e
Parents:
d17c114
Message:

2008-07-24 Joel Sherrill <joel.sherrill@…>

PR 1291/cpukit

  • psx05/init.c, psxmsgq01/init.c, psxmsgq01/system.h, psxsem01/init.c, psxsem01/psxsem01.scn: Update tests to reflect changes required by problem.
Location:
testsuites/psxtests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    rd17c114 r1750f5a6  
     12008-07-24      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        PR 1291/cpukit
     4        * psx05/init.c, psxmsgq01/init.c, psxmsgq01/system.h, psxsem01/init.c,
     5        psxsem01/psxsem01.scn: Update tests to reflect changes required by
     6        problem.
     7
    182006-12-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    29
  • testsuites/psxtests/psx05/init.c

    rd17c114 r1750f5a6  
    7373}
    7474
     75void calculate_abstimeout(
     76  struct timespec *times,
     77  uint32_t         seconds,
     78  uint32_t         nanoseconds
     79)
     80{
     81  struct timeval       tv1;
     82  struct timezone      tz1;
     83
     84  gettimeofday( &tv1, &tz1 );
     85
     86  times->tv_sec  = seconds     + tv1.tv_sec;
     87  times->tv_nsec = nanoseconds + (tv1.tv_usec * 1000);
     88
     89  while ( times->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
     90    times->tv_sec++;
     91    times->tv_nsec - TOD_NANOSECONDS_PER_SECOND;
     92  }
     93
     94}
     95
    7596void *POSIX_Init(
    7697  void *argument
     
    344365  assert( status == EPERM );
    345366
    346   times.tv_sec = 0;
    347   times.tv_nsec = 500000000;
    348367  puts( "Init: pthread_mutex_timedlock - time out in 1/2 second" );
     368  calculate_abstimeout( &times, 0, (TOD_NANOSECONDS_PER_SECOND / 2) );
     369
    349370  status = pthread_mutex_timedlock( &Mutex_id, &times );
    350   if ( status != EAGAIN )
    351     printf( "status = %d\n", status );
    352   assert( status == EAGAIN );
     371  if ( status != ETIMEDOUT )
     372    printf( "status = %d\n", status );
     373  assert( status == ETIMEDOUT );
    353374
    354375     /* switch to idle */
  • testsuites/psxtests/psxmsgq01/init.c

    rd17c114 r1750f5a6  
    751751  char            *msg;
    752752
    753   timeout.tv_sec  = 1;
    754   timeout.tv_nsec = 0;
    755 
    756753  printf( "Init: mq_timedsend - on queue %s ", Test_q[que].name);
    757754  len = Predefined_Msgs[MAXMSG].size;
    758755  msg = Predefined_Msgs[MAXMSG].msg;
     756
    759757  gettimeofday( &tv1, &tz1 );
     758  timeout.tv_sec  = tv1.tv_sec + 1;
     759  timeout.tv_nsec = tv1.tv_usec * 1000;
     760
    760761  status = mq_timedsend( Test_q[que].mq, msg, len , 0, &timeout );
     762
    761763  gettimeofday( &tv2, &tz2 );
    762764  tv3.tv_sec  = tv2.tv_sec - tv1.tv_sec;
     
    764766
    765767  if ( is_blocking ) { /* Don't verify the non-blocking queue */
    766     fatal_int_service_status( status, -1, "mq_timedsend status");
    767     fatal_posix_service_status( errno, ETIMEDOUT,  "errno ETIMEDOUT");
    768   }
    769 
    770   printf("Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
    771 
    772   if ( is_blocking ) /* non-blocking queue */
    773     assert( tv3.tv_sec == 1 );
    774   else
    775     assert( tv3.tv_sec == 0 );
     768    fatal_int_service_status( status, -1, "mq_timedsend status" );
     769    fatal_posix_service_status( errno, ETIMEDOUT,  "errno ETIMEDOUT" );
     770  }
     771
     772  printf( "Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
    776773
    777774  if ( que == DEFAULT_RW )
     
    806803  int              status;
    807804
    808   tm.tv_sec  = 1;
    809   tm.tv_nsec = 0;
    810 
    811   printf( "Init: %s mq_timedreceive - on queue %s ", task_name, Test_q[que].name);
     805  printf(
     806    "Init: %s mq_timedreceive - on queue %s ",
     807    task_name,
     808    Test_q[que].name
     809  );
    812810
    813811  gettimeofday( &tv1, &tz1 );
     812  tm.tv_sec  = tv1.tv_sec + 1;
     813  tm.tv_nsec = tv1.tv_usec * 1000;
     814
    814815  status = mq_timedreceive( Test_q[ que ].mq, message, 100, &priority, &tm );
     816
    815817  gettimeofday( &tv2, &tz2 );
    816818  tv3.tv_sec  = tv2.tv_sec - tv1.tv_sec;
     
    822824  printf( "Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
    823825
    824   if ( is_blocking )
    825     assert( tv3.tv_sec == 1 );
    826   else
    827     assert( tv3.tv_sec == 0 );
    828 }
    829 
    830 
     826}
    831827
    832828void verify_timed_receive()
  • testsuites/psxtests/psxmsgq01/system.h

    rd17c114 r1750f5a6  
    4545#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
    4646        (RTEMS_MINIMUM_STACK_SIZE * 10)
     47#define STACK_CHECKER_ON
    4748
    4849#include <rtems/confdefs.h>
  • testsuites/psxtests/psxsem01/init.c

    rd17c114 r1750f5a6  
    115115  fatal_posix_service_status( errno, ETIMEDOUT, "sem_timedwait errno ETIMEDOUT");
    116116
    117   puts( "Init: sem_timedwait - UNSUCCESSFUL (EINVAL)" );
     117  puts( "Init: sem_timedwait - UNSUCCESSFUL (EAGAIN)" );
    118118  waittime.tv_sec = 0;
    119119  waittime.tv_nsec = 0x7FFFFFFF;
    120120  status = sem_timedwait(&sems[2], &waittime);
    121121  fatal_posix_service_status( status, -1, "sem_timedwait error return status");
    122   fatal_posix_service_status( errno, EINVAL, "sem_init errno EINVAL");
     122  fatal_posix_service_status( errno, EAGAIN, "sem_init errno EAGAIN");
    123123
    124124  puts( "Init: sem_post - UNSUCCESSFUL (EINVAL)" );
  • testsuites/psxtests/psxsem01/psxsem01.scn

    rd17c114 r1750f5a6  
    1616Init: sem_timedwait - SUCCESSFUL
    1717Init: sem_timedwait - UNSUCCESSFUL (ETIMEDOUT)
    18 Init: sem_timedwait - UNSUCCESSFUL (EINVAL)
     18Init: sem_timedwait - UNSUCCESSFUL (EAGAIN)
    1919Init: sem_post - UNSUCCESSFUL (EINVAL)
    2020Init: sem_destroy - SUCCESSFUL
Note: See TracChangeset for help on using the changeset viewer.