summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-07-24 20:43:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-07-24 20:43:58 +0000
commit1750f5a6913a370c758666f2d008994e7ded40ec (patch)
tree8db13058cc9d5da0efbb87a87a7be22032c726f2
parent2008-07-24 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-1750f5a6913a370c758666f2d008994e7ded40ec.tar.bz2
2008-07-24 Joel Sherrill <joel.sherrill@OARcorp.com>
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.
-rw-r--r--testsuites/psxtests/ChangeLog7
-rw-r--r--testsuites/psxtests/psx05/init.c29
-rw-r--r--testsuites/psxtests/psxmsgq01/init.c38
-rw-r--r--testsuites/psxtests/psxmsgq01/system.h1
-rw-r--r--testsuites/psxtests/psxsem01/init.c4
-rw-r--r--testsuites/psxtests/psxsem01/psxsem01.scn2
6 files changed, 53 insertions, 28 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog
index 1b9f0a48a3..74d84f4ecb 100644
--- a/testsuites/psxtests/ChangeLog
+++ b/testsuites/psxtests/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-24 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ 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.
+
2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: New BUG-REPORT address.
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index 5ffe5064c2..9a79f253dc 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -72,6 +72,27 @@ void Print_mutexattr(
}
}
+void calculate_abstimeout(
+ struct timespec *times,
+ uint32_t seconds,
+ uint32_t nanoseconds
+)
+{
+ struct timeval tv1;
+ struct timezone tz1;
+
+ gettimeofday( &tv1, &tz1 );
+
+ times->tv_sec = seconds + tv1.tv_sec;
+ times->tv_nsec = nanoseconds + (tv1.tv_usec * 1000);
+
+ while ( times->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
+ times->tv_sec++;
+ times->tv_nsec - TOD_NANOSECONDS_PER_SECOND;
+ }
+
+}
+
void *POSIX_Init(
void *argument
)
@@ -343,13 +364,13 @@ void *POSIX_Init(
printf( "status = %d\n", status );
assert( status == EPERM );
- times.tv_sec = 0;
- times.tv_nsec = 500000000;
puts( "Init: pthread_mutex_timedlock - time out in 1/2 second" );
+ calculate_abstimeout( &times, 0, (TOD_NANOSECONDS_PER_SECOND / 2) );
+
status = pthread_mutex_timedlock( &Mutex_id, &times );
- if ( status != EAGAIN )
+ if ( status != ETIMEDOUT )
printf( "status = %d\n", status );
- assert( status == EAGAIN );
+ assert( status == ETIMEDOUT );
/* switch to idle */
diff --git a/testsuites/psxtests/psxmsgq01/init.c b/testsuites/psxtests/psxmsgq01/init.c
index b152ffc6fb..7ddb5827c8 100644
--- a/testsuites/psxtests/psxmsgq01/init.c
+++ b/testsuites/psxtests/psxmsgq01/init.c
@@ -750,29 +750,26 @@ void verify_timed_send_queue(
int status;
char *msg;
- timeout.tv_sec = 1;
- timeout.tv_nsec = 0;
-
printf( "Init: mq_timedsend - on queue %s ", Test_q[que].name);
len = Predefined_Msgs[MAXMSG].size;
msg = Predefined_Msgs[MAXMSG].msg;
+
gettimeofday( &tv1, &tz1 );
+ timeout.tv_sec = tv1.tv_sec + 1;
+ timeout.tv_nsec = tv1.tv_usec * 1000;
+
status = mq_timedsend( Test_q[que].mq, msg, len , 0, &timeout );
+
gettimeofday( &tv2, &tz2 );
tv3.tv_sec = tv2.tv_sec - tv1.tv_sec;
tv3.tv_usec = tv2.tv_usec - tv1.tv_usec;
if ( is_blocking ) { /* Don't verify the non-blocking queue */
- fatal_int_service_status( status, -1, "mq_timedsend status");
- fatal_posix_service_status( errno, ETIMEDOUT, "errno ETIMEDOUT");
+ fatal_int_service_status( status, -1, "mq_timedsend status" );
+ fatal_posix_service_status( errno, ETIMEDOUT, "errno ETIMEDOUT" );
}
- printf("Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
-
- if ( is_blocking ) /* non-blocking queue */
- assert( tv3.tv_sec == 1 );
- else
- assert( tv3.tv_sec == 0 );
+ printf( "Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
if ( que == DEFAULT_RW )
Test_q[que].count++;
@@ -805,13 +802,18 @@ void verify_timed_receive_queue(
struct timezone tz1, tz2;
int status;
- tm.tv_sec = 1;
- tm.tv_nsec = 0;
-
- printf( "Init: %s mq_timedreceive - on queue %s ", task_name, Test_q[que].name);
+ printf(
+ "Init: %s mq_timedreceive - on queue %s ",
+ task_name,
+ Test_q[que].name
+ );
gettimeofday( &tv1, &tz1 );
+ tm.tv_sec = tv1.tv_sec + 1;
+ tm.tv_nsec = tv1.tv_usec * 1000;
+
status = mq_timedreceive( Test_q[ que ].mq, message, 100, &priority, &tm );
+
gettimeofday( &tv2, &tz2 );
tv3.tv_sec = tv2.tv_sec - tv1.tv_sec;
tv3.tv_usec = tv2.tv_usec - tv1.tv_usec;
@@ -821,14 +823,8 @@ void verify_timed_receive_queue(
fatal_posix_service_status( errno, ETIMEDOUT, "errno ETIMEDOUT");
printf( "Init: %ld sec %ld us\n", (long)tv3.tv_sec, (long)tv3.tv_usec );
- if ( is_blocking )
- assert( tv3.tv_sec == 1 );
- else
- assert( tv3.tv_sec == 0 );
}
-
-
void verify_timed_receive()
{
int que;
diff --git a/testsuites/psxtests/psxmsgq01/system.h b/testsuites/psxtests/psxmsgq01/system.h
index 369d2ef619..98b88db803 100644
--- a/testsuites/psxtests/psxmsgq01/system.h
+++ b/testsuites/psxtests/psxmsgq01/system.h
@@ -44,6 +44,7 @@ void *Task_1_through_3(
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
(RTEMS_MINIMUM_STACK_SIZE * 10)
+#define STACK_CHECKER_ON
#include <rtems/confdefs.h>
diff --git a/testsuites/psxtests/psxsem01/init.c b/testsuites/psxtests/psxsem01/init.c
index 3d8b43f97a..80d962549c 100644
--- a/testsuites/psxtests/psxsem01/init.c
+++ b/testsuites/psxtests/psxsem01/init.c
@@ -114,12 +114,12 @@ void *POSIX_Init(
fatal_posix_service_status( status, -1, "sem_timedwait error return status");
fatal_posix_service_status( errno, ETIMEDOUT, "sem_timedwait errno ETIMEDOUT");
- puts( "Init: sem_timedwait - UNSUCCESSFUL (EINVAL)" );
+ puts( "Init: sem_timedwait - UNSUCCESSFUL (EAGAIN)" );
waittime.tv_sec = 0;
waittime.tv_nsec = 0x7FFFFFFF;
status = sem_timedwait(&sems[2], &waittime);
fatal_posix_service_status( status, -1, "sem_timedwait error return status");
- fatal_posix_service_status( errno, EINVAL, "sem_init errno EINVAL");
+ fatal_posix_service_status( errno, EAGAIN, "sem_init errno EAGAIN");
puts( "Init: sem_post - UNSUCCESSFUL (EINVAL)" );
status = sem_post(&sem2);
diff --git a/testsuites/psxtests/psxsem01/psxsem01.scn b/testsuites/psxtests/psxsem01/psxsem01.scn
index cf8cf13fb1..efeae40fa8 100644
--- a/testsuites/psxtests/psxsem01/psxsem01.scn
+++ b/testsuites/psxtests/psxsem01/psxsem01.scn
@@ -15,7 +15,7 @@ Init: sem_trywait - UNSUCCESSFUL (EAGAIN)
Init: sem_trywait - UNSUCCESSFUL (EINVAL)
Init: sem_timedwait - SUCCESSFUL
Init: sem_timedwait - UNSUCCESSFUL (ETIMEDOUT)
-Init: sem_timedwait - UNSUCCESSFUL (EINVAL)
+Init: sem_timedwait - UNSUCCESSFUL (EAGAIN)
Init: sem_post - UNSUCCESSFUL (EINVAL)
Init: sem_destroy - SUCCESSFUL
Init: sem_open - sem1 SUCCESSFUL