Index: testsuites/psxtests/ChangeLog
===================================================================
--- testsuites/psxtests/ChangeLog	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/ChangeLog	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -1,2 +1,8 @@
+2009-05-17	Joel Sherrill <joel.sherrill@OARcorp.com>
+
+	* psxsem01/Makefile.am, psxsem01/init.c, psxsem01/psxsem01.scn,
+	psxtimer01/psxtimer.c, psxtimer01/system.h, psxtimer02/psxtimer.c:
+	Improved so coverage is better.
+
 2009-05-17	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: testsuites/psxtests/psxsem01/Makefile.am
===================================================================
--- testsuites/psxtests/psxsem01/Makefile.am	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/psxsem01/Makefile.am	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -6,5 +6,6 @@
 
 rtems_tests_PROGRAMS = psxsem01
-psxsem01_SOURCES = init.c system.h ../include/pmacros.h
+psxsem01_SOURCES = init.c system.h ../include/pmacros.h \
+     ../../support/src/test_support.c
 
 dist_rtems_tests_DATA = psxsem01.scn
Index: testsuites/psxtests/psxsem01/init.c
===================================================================
--- testsuites/psxtests/psxsem01/init.c	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/psxsem01/init.c	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -5,4 +5,5 @@
 #include <time.h>
 #include <tmacros.h>
+#include "test_support.h"
 
 void *POSIX_Init(
@@ -22,4 +23,9 @@
   puts( "\n\n*** POSIX SEMAPHORE MANAGER TEST 1 ***" );
 
+  puts( "Init: sem_init - UNSUCCESSFUL (EINVAL)" );
+  status = sem_init(NULL, 0, 1);
+  fatal_posix_service_status( status, -1, "sem_init error return status");
+  fatal_posix_service_status( errno, EINVAL, "sem_init errorno EINVAL" );
+
   puts( "Init: sem_init - SUCCESSFUL" );
   for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) {
@@ -113,5 +119,6 @@
   status = sem_timedwait(&sems[2], &waittime);
   fatal_posix_service_status( status, -1, "sem_timedwait error return status");
-  fatal_posix_service_status( errno, ETIMEDOUT, "sem_timedwait errno ETIMEDOUT");
+  fatal_posix_service_status(
+    errno, ETIMEDOUT, "sem_timedwait errno ETIMEDOUT");
 
   /*
@@ -149,10 +156,21 @@
    */
 
+  puts( "Init: sem_open - UNSUCCESSFUL (ENAMETOOLONG)" );
+  status = sem_open(Get_Too_Long_Name(), O_CREAT, 0777, 1 );
+  fatal_posix_service_status( status, -1, "sem_open error return status");
+  fatal_posix_service_status(
+    errno, ENAMETOOLONG, "sem_open errorno ENAMETOOLONG" );
+
   puts( "Init: sem_open - sem1 SUCCESSFUL" );
-  n_sem1 = sem_open( "sem1", O_CREAT, 00777, 1 );
+  n_sem1 = sem_open( "sem1",O_CREAT, 0777, 1 ); 
   assert( n_sem1 != SEM_FAILED );
 
+  puts( "Init: sem_destroy - named sem1 - EINVAL" );
+  status = sem_destroy(n_sem1);
+  fatal_posix_service_status( status, -1, "sem_destroy named semaphore");
+  fatal_posix_service_status( errno, EINVAL,  "sem_destroy named semaphore");
+
   puts( "Init: sem_open - Create an Existing sem (EEXIST)" );
-  n_sem2 = sem_open("sem1", O_CREAT | O_EXCL, 00777, 1);
+  n_sem2 = sem_open("sem1", O_CREAT | O_EXCL, 0777, 1);
   fatal_posix_service_status(
     (int) n_sem2, (int ) SEM_FAILED, "sem_open error return status" );
@@ -160,5 +178,5 @@
 
   puts( "Init: sem_open - Open new sem without create flag (ENOENT)" );
-  n_sem2 = sem_open("sem3", O_EXCL, 00777, 1);
+  n_sem2 = sem_open("sem3", O_EXCL, 0777, 1);
   fatal_posix_service_status(
     (int) n_sem2, (int ) SEM_FAILED, "sem_open error return status" );
@@ -199,5 +217,5 @@
 
   puts( "Init: sem_open - Reopen sem1 SUCCESSFUL with a different id" );
-  n_sem2 = sem_open( "sem1", O_CREAT | O_EXCL, 00777, 1);
+  n_sem2 = sem_open( "sem1", O_CREAT | O_EXCL, 0777, 1);
   assert( n_sem2 != SEM_FAILED );
   assert( n_sem2 != n_sem1 );
Index: testsuites/psxtests/psxsem01/psxsem01.scn
===================================================================
--- testsuites/psxtests/psxsem01/psxsem01.scn	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/psxsem01/psxsem01.scn	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -1,3 +1,4 @@
 *** POSIX SEMAPHORE MANAGER TEST 1 ***
+Init: sem_init - UNSUCCESSFUL (EINVAL)
 Init: sem_init - SUCCESSFUL
 Init: sem_init - UNSUCCESSFUL (ENOSPC)
@@ -19,5 +20,7 @@
 Init: sem_post - UNSUCCESSFUL (EINVAL)
 Init: sem_destroy - SUCCESSFUL
+Init: sem_open - UNSUCCESSFUL (ENAMETOOLONG)
 Init: sem_open - sem1 SUCCESSFUL
+Init: sem_destroy - named sem1 - EINVAL
 Init: sem_open - Create an Existing sem (EEXIST)
 Init: sem_open - Open new sem without create flag (ENOENT)
Index: testsuites/psxtests/psxtimer01/psxtimer.c
===================================================================
--- testsuites/psxtests/psxtimer01/psxtimer.c	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/psxtimer01/psxtimer.c	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -64,7 +64,9 @@
 )
 {
+   struct   itimerspec prev;
+
    timerdata->it_value.tv_sec  = 0;
    timerdata->it_value.tv_nsec  = 0;
-   if (timer_settime(timer_id,POSIX_TIMER_RELATIVE,timerdata,NULL) == -1) {
+   if (timer_settime(timer_id,POSIX_TIMER_RELATIVE,timerdata,&prev) == -1) {
      perror ("Error in timer setting\n");
      pthread_exit ((void *) -1);
@@ -308,9 +310,9 @@
    pthread_condattr_t  condattr;     /* condition attributes */
    pthread_attr_t attr;              /* task attributes */
-   pthread_t ta,tb,tc;               /* threads */
+   pthread_t ta,tb,tc, tc1;          /* threads */
    sigset_t  set;                    /* signals */
 
    struct sched_param sch_param;     /* schedule parameters */
-   struct periodic_params params_a, params_b, params_c;
+   struct periodic_params params_a, params_b, params_c, params_c1;
 
    puts( "\n\n*** POSIX Timers Test 01 ***" );
@@ -413,7 +415,19 @@
    }
 
-
    /* execute 25 seconds and finish */
    sleep (25);
+
+   puts( "starting C again with 0.5 second periodicity" );
+   /* Temporal parameters (0.5 sec. periodicity) */
+   params_c1.period.tv_sec  = 0;         /* seconds */
+   params_c1.period.tv_nsec = 500000000; /* nanoseconds */
+   params_c1.count          = 6;
+   params_c1.signo = SIGALRM;
+   if (pthread_create (&tc1, &attr, task_c, &params_c1) != 0) {
+     perror ("Error in thread create for task c1\n");
+   }
+
+   sleep(5);
+
    puts( "*** END OF POSIX Timers Test 01 ***" );
    rtems_test_exit (0);
Index: testsuites/psxtests/psxtimer01/system.h
===================================================================
--- testsuites/psxtests/psxtimer01/system.h	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/psxtimer01/system.h	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -42,6 +42,6 @@
 #define CONFIGURE_POSIX_INIT_THREAD_TABLE
 
-#define CONFIGURE_MAXIMUM_POSIX_THREADS             4
-#define CONFIGURE_MAXIMUM_POSIX_TIMERS              4
+#define CONFIGURE_MAXIMUM_POSIX_THREADS             5
+#define CONFIGURE_MAXIMUM_POSIX_TIMERS              5
 #define CONFIGURE_MAXIMUM_TIMERS                    4
 #define CONFIGURE_MAXIMUM_POSIX_MUTEXES             2
Index: testsuites/psxtests/psxtimer02/psxtimer.c
===================================================================
--- testsuites/psxtests/psxtimer02/psxtimer.c	(revision 5b469b738762d116580b59fda15b74b6349c3ad2)
+++ testsuites/psxtests/psxtimer02/psxtimer.c	(revision 7a67dfbc62810a694e2f99a48e086c322bebe984)
@@ -104,4 +104,11 @@
   fatal_posix_service_status_errno( status, EINVAL, "bad itimer value #3" );
 
+  clock_gettime( CLOCK_REALTIME, &now );
+  itimer.it_value = now;
+  itimer.it_value.tv_sec = itimer.it_value.tv_sec + 1;
+  puts( "timer_settime - bad id - EINVAL" );
+  status = timer_settime( timer1, TIMER_ABSTIME, &itimer, NULL );
+  fatal_posix_service_status_errno( status, EINVAL, "bad id" );
+
   itimer.it_value.tv_nsec = 0;
   puts( "timer_settime - bad clock value - EINVAL" );
