diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index a87e20d1ed..4bffd6bdb3 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,8 @@ +2009-07-22 Joel Sherrill + + * psxsem01/Makefile.am, psxsem01/init.c: Much clean up. + * psxsem01/system.h: Removed. + 2009-07-22 Joel Sherrill * psxsem01/init.c: Eliminate warning. diff --git a/testsuites/psxtests/psxsem01/Makefile.am b/testsuites/psxtests/psxsem01/Makefile.am index 7053eccf6c..6b4291167f 100644 --- a/testsuites/psxtests/psxsem01/Makefile.am +++ b/testsuites/psxtests/psxsem01/Makefile.am @@ -5,7 +5,7 @@ MANAGERS = all rtems_tests_PROGRAMS = psxsem01 -psxsem01_SOURCES = init.c system.h ../include/pmacros.h \ +psxsem01_SOURCES = init.c ../include/pmacros.h \ ../../support/src/test_support.c dist_rtems_tests_DATA = psxsem01.scn diff --git a/testsuites/psxtests/psxsem01/init.c b/testsuites/psxtests/psxsem01/init.c index f57ba05b39..5f067bb16f 100644 --- a/testsuites/psxtests/psxsem01/init.c +++ b/testsuites/psxtests/psxsem01/init.c @@ -1,11 +1,25 @@ -#define CONFIGURE_INIT -#include "system.h" +/* + * COPYRIGHT (c) 1989-2009. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + #include +#include +#include #include #include #include +#include #include "test_support.h" +#define MAX_SEMS 10 + void *POSIX_Init( void *argument ) @@ -13,7 +27,7 @@ void *POSIX_Init( int status; int value; int i; - sem_t sems[CONFIGURE_MAXIMUM_POSIX_SEMAPHORES]; + sem_t sems[MAX_SEMS]; sem_t sem2; sem_t *n_sem1; sem_t *n_sem2; @@ -28,7 +42,7 @@ void *POSIX_Init( fatal_posix_service_status( errno, EINVAL, "sem_init errorno EINVAL" ); puts( "Init: sem_init - SUCCESSFUL" ); - for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) { + for (i = 0; i < MAX_SEMS; i++) { status = sem_init(&sems[i], 0, i); sprintf(failure_msg, "sem_init %d", i ); fatal_posix_service_status( status, 0, failure_msg); @@ -44,7 +58,7 @@ void *POSIX_Init( fatal_posix_service_status( errno, ENOSYS, "sem_init errno set to ENOSYS"); puts( "Init: sem_getvalue - SUCCESSFUL "); - for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) { + for (i = 0; i < MAX_SEMS; i++) { status = sem_getvalue(&sems[i], &value); sprintf( failure_msg, "sem_getvalue %d", i ); fatal_posix_service_status( status, 0, failure_msg ); @@ -143,7 +157,7 @@ void *POSIX_Init( fatal_posix_service_status( errno, EINVAL, "sem_post errno EINVAL"); puts( "Init: sem_destroy - SUCCESSFUL" ); - for (i = 1; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) { + for (i = 1; i < MAX_SEMS; i++) { status = sem_destroy(&sems[i]); sprintf( failure_msg, "sem_destroy %d", i ); fatal_posix_service_status( status, 0, failure_msg ); @@ -287,3 +301,19 @@ void *POSIX_Init( return NULL; /* just so the compiler thinks we returned something */ } + +/* configuration information */ +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 +#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES MAX_SEMS + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE +#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ + (RTEMS_MINIMUM_STACK_SIZE * 4) + +#define CONFIGURE_INIT +#include diff --git a/testsuites/psxtests/psxsem01/system.h b/testsuites/psxtests/psxsem01/system.h deleted file mode 100644 index 5a62affd46..0000000000 --- a/testsuites/psxtests/psxsem01/system.h +++ /dev/null @@ -1,54 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -/* functions */ - -#include -#include -#include -#include -#include -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 -#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 10 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE -#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ - (RTEMS_MINIMUM_STACK_SIZE * 4) - -#include - -/* global variables */ - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */