From 046f47154f6691db5d4bef5493f63eb609c0e57f Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 24 Jun 2009 06:35:29 +0000 Subject: 2009-06-24 Joel Sherrill * Makefile.am, configure.ac, spprintk/init.c, spprintk/spprintk.scn: Enhance spprintk. Add two new fatal error tests to cover __assert_func. * spfatal11/.cvsignore, spfatal11/Makefile.am, spfatal11/init.c, spfatal11/spfatal11.doc, spfatal11/spfatal11.scn: New files. --- testsuites/sptests/ChangeLog | 8 ++++++ testsuites/sptests/Makefile.am | 2 +- testsuites/sptests/configure.ac | 2 ++ testsuites/sptests/spfatal11/.cvsignore | 2 ++ testsuites/sptests/spfatal11/Makefile.am | 29 ++++++++++++++++++++++ testsuites/sptests/spfatal11/init.c | 39 ++++++++++++++++++++++++++++++ testsuites/sptests/spfatal11/spfatal11.doc | 22 +++++++++++++++++ testsuites/sptests/spfatal11/spfatal11.scn | 5 ++++ testsuites/sptests/spprintk/init.c | 4 ++- testsuites/sptests/spprintk/spprintk.scn | 31 ++++++++++++++++++++++++ 10 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 testsuites/sptests/spfatal11/.cvsignore create mode 100644 testsuites/sptests/spfatal11/Makefile.am create mode 100644 testsuites/sptests/spfatal11/init.c create mode 100644 testsuites/sptests/spfatal11/spfatal11.doc create mode 100644 testsuites/sptests/spfatal11/spfatal11.scn diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 68ced116d9..df7dc329be 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,11 @@ +2009-06-24 Joel Sherrill + + * Makefile.am, configure.ac, spprintk/init.c, spprintk/spprintk.scn: + Enhance spprintk. Add two new fatal error tests to cover + __assert_func. + * spfatal11/.cvsignore, spfatal11/Makefile.am, spfatal11/init.c, + spfatal11/spfatal11.doc, spfatal11/spfatal11.scn: New files. + 2009-06-18 Chris Johns * sp35/priinv.c, sp35/priinv.c: Declare unions volatile to diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index 9f5b1896ef..d35ffa35e1 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -10,7 +10,7 @@ SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \ sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \ sp45 sp46 sp47 sp48 sp49 sp50 sp51 sp52 sp53 sp54 spsize spwatchdog \ spfatal01 spfatal02 spfatal03 spfatal04 spfatal05 spfatal06 spfatal07 \ - spfatal08 spfatal09 spobjgetnext \ + spfatal08 spfatal09 spfatal10 spfatal11 spobjgetnext \ spprintk spwkspace DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index 284e7aa2e0..fc18ceb0a3 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -91,6 +91,8 @@ spfatal06/Makefile spfatal07/Makefile spfatal08/Makefile spfatal09/Makefile +spfatal10/Makefile +spfatal11/Makefile spobjgetnext/Makefile spprintk/Makefile spwkspace/Makefile diff --git a/testsuites/sptests/spfatal11/.cvsignore b/testsuites/sptests/spfatal11/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/sptests/spfatal11/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/sptests/spfatal11/Makefile.am b/testsuites/sptests/spfatal11/Makefile.am new file mode 100644 index 0000000000..0f83be669e --- /dev/null +++ b/testsuites/sptests/spfatal11/Makefile.am @@ -0,0 +1,29 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = spfatal11 +spfatal11_SOURCES = init.c + +dist_rtems_tests_DATA = spfatal11.scn +dist_rtems_tests_DATA += spfatal11.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +spfatal11_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include +AM_CPPFLAGS += -DUSE_TIMER_SERVER + +LINK_OBJS = $(spfatal11_OBJECTS) $(spfatal11_LDADD) +LINK_LIBS = $(spfatal11_LDLIBS) + +spfatal11$(EXEEXT): $(spfatal11_OBJECTS) $(spfatal11_DEPENDENCIES) + @rm -f spfatal11$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/spfatal11/init.c b/testsuites/sptests/spfatal11/init.c new file mode 100644 index 0000000000..13e83be900 --- /dev/null +++ b/testsuites/sptests/spfatal11/init.c @@ -0,0 +1,39 @@ +/* Test __assert_func with NULL function name + * + * 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 +#undef NDEBUG +#include + +rtems_task Init( + rtems_task_argument ignored +) +{ + puts( "\n\n*** TEST FATAL 11 ***" ); + + puts( "asserting with non-NULL strings...\n" ); + __assert_func( __FILE__, __LINE__, NULL, "forced" ); + +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT +#include + +/* global variables */ diff --git a/testsuites/sptests/spfatal11/spfatal11.doc b/testsuites/sptests/spfatal11/spfatal11.doc new file mode 100644 index 0000000000..1d2ff9dd82 --- /dev/null +++ b/testsuites/sptests/spfatal11/spfatal11.doc @@ -0,0 +1,22 @@ +# +# $Id$ +# +# 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. +# + +This file describes the directives and concepts tested by this test set. + +test set name: fatal 11 + +directives: + __assert_func + +concepts: + + a. Verify that the __assert_func method works as expected with NULL + function name. diff --git a/testsuites/sptests/spfatal11/spfatal11.scn b/testsuites/sptests/spfatal11/spfatal11.scn new file mode 100644 index 0000000000..4e8a76f809 --- /dev/null +++ b/testsuites/sptests/spfatal11/spfatal11.scn @@ -0,0 +1,5 @@ +*** TEST FATAL 11 *** +asserting with non-NULL strings... + +assertion "forced" failed: file "../../../../../../../rtems/c/src/../../testsuites/sptests/spfatal11/init.c", line 24 +program stopped with signal 2. diff --git a/testsuites/sptests/spprintk/init.c b/testsuites/sptests/spprintk/init.c index 4acf3e104c..bff53ac0bd 100644 --- a/testsuites/sptests/spprintk/init.c +++ b/testsuites/sptests/spprintk/init.c @@ -23,6 +23,8 @@ rtems_task Init( printk( "\n\n*** TEST PRINTK ***\n" ); + putk( "This is a test of putk\n" ); + printk( "bad format -- %%q in parentheses (%q)\n" ); printk( "bad format -- %%lq in parentheses (%lq)\n", 0x1234 ); @@ -56,7 +58,7 @@ rtems_task Init( printk( "%%c of X -- (%c)\n", 'X' ); - printk( "*** END OF TEST PRINTK ***" ); + printk( "*** END OF TEST PRINTK ***\n" ); rtems_test_exit( 0 ); } diff --git a/testsuites/sptests/spprintk/spprintk.scn b/testsuites/sptests/spprintk/spprintk.scn index e69de29bb2..48dac9f493 100644 --- a/testsuites/sptests/spprintk/spprintk.scn +++ b/testsuites/sptests/spprintk/spprintk.scn @@ -0,0 +1,31 @@ +sparc-rtems4.10-run is /opt/rtems-4.10/bin/sparc-rtems4.10-run + + +*** TEST PRINTK *** +This is a test of putk + +bad format -- %q in parentheses (q) +bad format -- %lq in parentheses (q) +%O octal upper case 16 -- 20 +%o octal lower case of 16 -- 20 +%I of 16 -- 16 +%i of 16 -- 16 +%D of 16 -- 16 +%d of 16 -- 16 +%-3d of 16 -- 16 +%U of 16 -- 16 +%u of 16 -- 16 +%X of 16 -- 10 +%x of 16 -- 10 +%p of 0x1234 -- 1234 +%d of -16 -- -16 +%d of -16 -- -16 +%u of -16 -- 4294967280 +%s of Mary Had a Little Lamb -- (Mary Had a Little Lamb) +%s of NULL -- () +%12s of joel -- ( joel) +%4s of joel -- (joel) +%-12s of joel -- (joel ) +%-4s of joel -- (joel) +%c of X -- (X) +*** END OF TEST PRINTK *** \ No newline at end of file -- cgit v1.2.3