2009-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>

* Makefile.am, configure.ac: Add new test to provide coverage analysis
	of the current implementation of getitimer() and setitimer().
	* psxitimer/.cvsignore, psxitimer/Makefile.am, psxitimer/init.c,
	psxitimer/psxitimer.scn: New files.
This commit is contained in:
Joel Sherrill
2009-05-15 17:42:27 +00:00
parent 760076d746
commit 9bced10753
7 changed files with 138 additions and 1 deletions
+7
View File
@@ -1,3 +1,10 @@
2009-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: Add new test to provide coverage analysis
of the current implementation of getitimer() and setitimer().
* psxitimer/.cvsignore, psxitimer/Makefile.am, psxitimer/init.c,
psxitimer/psxitimer.scn: New files.
2009-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* psxsysconf/init.c, psxsysconf/psxsysconf.scn: Add missing error test
+1 -1
View File
@@ -8,7 +8,7 @@ SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
psx10 psx11 psx12 psx13 psx14 psxcleanup psxtime psxtimer01 psxtimer02 \
psxcancel psxbarrier01 psxmsgq01 psxmsgq02 psxrwlock01 psxsem01 \
psxspin01 psxenosys psxsignal01 psxsysconf psxualarm psxkey01 \
psxfatal01 psxfatal02
psxfatal01 psxfatal02 psxitimer
## File IO tests
SUBDIRS += psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01
+1
View File
@@ -50,6 +50,7 @@ psxfatal01/Makefile
psxfatal02/Makefile
psxfile01/Makefile
psxhdrs/Makefile
psxitimer/Makefile
psxkey01/Makefile
psxmount/Makefile
psxmsgq01/Makefile
+2
View File
@@ -0,0 +1,2 @@
Makefile
Makefile.in
+28
View File
@@ -0,0 +1,28 @@
##
## $Id$
##
MANAGERS = all
rtems_tests_PROGRAMS = psxitimer
psxitimer_SOURCES = init.c ../include/pmacros.h
dist_rtems_tests_DATA = psxitimer.scn
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am
psxitimer_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
LINK_OBJS = $(psxitimer_OBJECTS) $(psxitimer_LDADD)
LINK_LIBS = $(psxitimer_LDLIBS)
psxitimer$(EXEEXT): $(psxitimer_OBJECTS) $(psxitimer_DEPENDENCIES)
@rm -f psxitimer$(EXEEXT)
$(make-exe)
include $(top_srcdir)/../automake/local.am
+86
View File
@@ -0,0 +1,86 @@
/*
* 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 <pmacros.h>
#include <sys/time.h>
#include <errno.h>
void *POSIX_Init(
void *argument
)
{
int status;
struct itimerval itimer;
struct itimerval otimer;
puts( "\n\n*** POSIX TEST ITIMER ***" );
/* test getitimer stub */
puts( "getitimer -- bad which - EINVAL " );
status = getitimer( 1234, &itimer );
assert( status == -1 && errno == EINVAL );
puts( "getitimer -- NULL pointer - EFAULT " );
status = getitimer( ITIMER_REAL, NULL );
assert( status == -1 && errno == EFAULT );
puts( "getitimer -- ITIMER_REAL - ENOSYS " );
status = getitimer( ITIMER_REAL, &itimer );
assert( status == -1 && errno == ENOSYS );
puts( "getitimer -- ITIMER_VIRTUAL - ENOSYS " );
status = getitimer( ITIMER_VIRTUAL, &itimer );
assert( status == -1 && errno == ENOSYS );
puts( "getitimer -- ITIMER_PROF - ENOSYS " );
status = getitimer( ITIMER_PROF, &itimer );
assert( status == -1 && errno == ENOSYS );
/* test setitimer stub */
puts( "setitimer -- bad which - EINVAL " );
status = setitimer( 1234, &itimer, &otimer );
assert( status == -1 && errno == EINVAL );
puts( "setitimer -- NULL value pointer - EFAULT " );
status = setitimer( ITIMER_REAL, NULL, &otimer );
assert( status == -1 && errno == EFAULT );
puts( "setitimer -- NULL value pointer - EFAULT " );
status = setitimer( ITIMER_REAL, &itimer, NULL );
assert( status == -1 && errno == EFAULT );
puts( "setitimer -- ITIMER_REAL - ENOSYS " );
status = setitimer( ITIMER_REAL, &itimer, &otimer );
assert( status == -1 && errno == ENOSYS );
puts( "setitimer -- ITIMER_VIRTUAL - ENOSYS " );
status = setitimer( ITIMER_VIRTUAL, &itimer, &otimer );
assert( status == -1 && errno == ENOSYS );
puts( "setitimer -- ITIMER_PROF - ENOSYS " );
status = setitimer( ITIMER_PROF, &itimer, &otimer );
assert( status == -1 && errno == ENOSYS );
puts( "*** END OF POSIX TEST ITIMER ***" );
rtems_test_exit(0);
}
/* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
@@ -0,0 +1,13 @@
*** POSIX TEST ITIMER ***
getitimer -- bad which - EINVAL
getitimer -- NULL pointer - EFAULT
getitimer -- ITIMER_REAL - ENOSYS
getitimer -- ITIMER_VIRTUAL - ENOSYS
getitimer -- ITIMER_PROF - ENOSYS
setitimer -- bad which - EINVAL
setitimer -- NULL value pointer - EFAULT
setitimer -- NULL value pointer - EFAULT
setitimer -- ITIMER_REAL - ENOSYS
setitimer -- ITIMER_VIRTUAL - ENOSYS
setitimer -- ITIMER_PROF - ENOSYS
*** END OF POSIX TEST ITIMER ***