From ad7e2f02f09154451702232e2ee863cf74a5938b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 27 Jul 2010 14:45:10 +0000 Subject: 2010-07-27 Bharath Suri PR 1631/testing * gxx02/init.c, gxx02/gxx02.scn, gxx02/gxx02.doc, gxx02/Makefile.am, gxx02/gxx_wrappers.h: New test added * Makefile.am, configure.ac: Changes to accommodate new tests --- testsuites/libtests/ChangeLog | 7 +++++ testsuites/libtests/Makefile.am | 2 +- testsuites/libtests/configure.ac | 1 + testsuites/libtests/gxx02/.cvsignore | 2 ++ testsuites/libtests/gxx02/Makefile.am | 27 +++++++++++++++++ testsuites/libtests/gxx02/gxx02.doc | 23 ++++++++++++++ testsuites/libtests/gxx02/gxx02.scn | 6 ++++ testsuites/libtests/gxx02/init.c | 56 +++++++++++++++++++++++++++++++++++ 8 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 testsuites/libtests/gxx02/.cvsignore create mode 100644 testsuites/libtests/gxx02/Makefile.am create mode 100644 testsuites/libtests/gxx02/gxx02.doc create mode 100644 testsuites/libtests/gxx02/gxx02.scn create mode 100644 testsuites/libtests/gxx02/init.c (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 4099218aaf..d6f7175a0f 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,10 @@ +2010-07-27 Bharath Suri + + PR 1631/testing + * gxx02/init.c, gxx02/gxx02.scn, gxx02/gxx02.doc, + gxx02/Makefile.am, gxx02/gxx_wrappers.h: New test added + * Makefile.am, configure.ac: Changes to accommodate new tests + 2010-07-27 Joel Sherrill PR 1632/testing diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index f1f5fa5bda..7deac6b08c 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -7,7 +7,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal SUBDIRS = POSIX SUBDIRS += bspcmdline01 cpuuse devfs01 devfs02 devfs03 devfs04 \ - devnullfatal01 gxx01 \ + devnullfatal01 gxx01 gxx02 \ malloctest malloc02 malloc03 malloc04 malloc05 heapwalk \ putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \ termios termios01 termios02 termios03 termios04 termios05 \ diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac index ff3b9cff5a..1e5cc9822c 100644 --- a/testsuites/libtests/configure.ac +++ b/testsuites/libtests/configure.ac @@ -51,6 +51,7 @@ devfs03/Makefile devfs04/Makefile devnullfatal01/Makefile gxx01/Makefile +gxx02/Makefile heapwalk/Makefile malloctest/Makefile malloc02/Makefile diff --git a/testsuites/libtests/gxx02/.cvsignore b/testsuites/libtests/gxx02/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/libtests/gxx02/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/libtests/gxx02/Makefile.am b/testsuites/libtests/gxx02/Makefile.am new file mode 100644 index 0000000000..c5716deedc --- /dev/null +++ b/testsuites/libtests/gxx02/Makefile.am @@ -0,0 +1,27 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = gxx02 +gxx02_SOURCES = init.c + +dist_rtems_tests_DATA = gxx02.scn +dist_rtems_tests_DATA += gxx02.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include +AM_CPPFLAGS += -I$(top_srcdir)/gxx01 + +LINK_OBJS = $(gxx02_OBJECTS) $(gxx02_LDADD) +LINK_LIBS = $(gxx02_LDLIBS) + +gxx02$(EXEEXT): $(gxx02_OBJECTS) $(gxx02_DEPENDENCIES) + @rm -f gxx02$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/libtests/gxx02/gxx02.doc b/testsuites/libtests/gxx02/gxx02.doc new file mode 100644 index 0000000000..bbedaa1cfc --- /dev/null +++ b/testsuites/libtests/gxx02/gxx02.doc @@ -0,0 +1,23 @@ +# +# $Id$ +# +# COPYRIGHT (c) 1989-2010. +# 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. +# + +This file describes the directives and concepts tested by this test set. + +test set name: gxx01 + +directives: + + rtems_gxx_getspecific + +concepts: + ++ Exercise an error path in the rtems_gxx_getspecific() routine, +leading to a rtems_panic diff --git a/testsuites/libtests/gxx02/gxx02.scn b/testsuites/libtests/gxx02/gxx02.scn new file mode 100644 index 0000000000..0ed0b038d5 --- /dev/null +++ b/testsuites/libtests/gxx02/gxx02.scn @@ -0,0 +1,6 @@ +*** TEST GXX 02 *** +Init - allocating most of workspace memory +rtems_gxx_getspecific() - panic and exit +*** END OF TEST GXX 02 *** +rtems_gxx_getspecific +fatal error, exiting diff --git a/testsuites/libtests/gxx02/init.c b/testsuites/libtests/gxx02/init.c new file mode 100644 index 0000000000..babf4e6b77 --- /dev/null +++ b/testsuites/libtests/gxx02/init.c @@ -0,0 +1,56 @@ +/* + * COPYRIGHT (c) 1989-2010. + * 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 "test_support.h" +#include "gxx_wrappers.h" +#include + +rtems_task Init( + rtems_task_argument argument +) +{ + + void *alloc_ptr = (void *)0; + Heap_Information_block Info; + __gthread_key_t key = 0; + int status = 0; + void *retptr; + + puts( "\n\n*** TEST GXX 02 ***" ); + + puts( "Init - allocating most of workspace memory" ); + status = rtems_workspace_get_information( &Info ); + rtems_test_assert( status == true ); + status = rtems_workspace_allocate( Info.Free.largest - 4, &alloc_ptr ); + rtems_test_assert( status == true ); + + puts( "rtems_gxx_getspecific() - panic and exit" ); + + puts( "*** END OF TEST GXX 02 ***" ); + + /* The below call will not return and hence the END OF above */ + retptr = rtems_gxx_getspecific( key ); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_SEMAPHORES 2 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT + +#include +/* end of file */ -- cgit v1.2.3