From d0e825d0b9dad90af550c5fbbccb5a00d01c6117 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 2 Aug 2010 18:17:11 +0000 Subject: 2010-08-02 Joel Sherrill * Makefile.am, configure.ac: Add test for rtems_print_buffer(). * dumpbuf01/.cvsignore, dumpbuf01/Makefile.am, dumpbuf01/dumpbuf01.doc, dumpbuf01/dumpbuf01.scn, dumpbuf01/init.c: New files. --- testsuites/libtests/dumpbuf01/.cvsignore | 2 + testsuites/libtests/dumpbuf01/Makefile.am | 26 ++++ testsuites/libtests/dumpbuf01/dumpbuf01.doc | 22 ++++ testsuites/libtests/dumpbuf01/dumpbuf01.scn | 189 ++++++++++++++++++++++++++++ testsuites/libtests/dumpbuf01/init.c | 57 +++++++++ 5 files changed, 296 insertions(+) create mode 100644 testsuites/libtests/dumpbuf01/.cvsignore create mode 100644 testsuites/libtests/dumpbuf01/Makefile.am create mode 100644 testsuites/libtests/dumpbuf01/dumpbuf01.doc create mode 100644 testsuites/libtests/dumpbuf01/dumpbuf01.scn create mode 100644 testsuites/libtests/dumpbuf01/init.c (limited to 'testsuites/libtests/dumpbuf01') diff --git a/testsuites/libtests/dumpbuf01/.cvsignore b/testsuites/libtests/dumpbuf01/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/libtests/dumpbuf01/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/libtests/dumpbuf01/Makefile.am b/testsuites/libtests/dumpbuf01/Makefile.am new file mode 100644 index 0000000000..8da92734f2 --- /dev/null +++ b/testsuites/libtests/dumpbuf01/Makefile.am @@ -0,0 +1,26 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = dumpbuf01 +dumpbuf01_SOURCES = init.c + +dist_rtems_tests_DATA = dumpbuf01.scn +dist_rtems_tests_DATA += dumpbuf01.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 + +LINK_OBJS = $(dumpbuf01_OBJECTS) $(dumpbuf01_LDADD) +LINK_LIBS = $(dumpbuf01_LDLIBS) + +dumpbuf01$(EXEEXT): $(dumpbuf01_OBJECTS) $(dumpbuf01_DEPENDENCIES) + @rm -f dumpbuf01$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/libtests/dumpbuf01/dumpbuf01.doc b/testsuites/libtests/dumpbuf01/dumpbuf01.doc new file mode 100644 index 0000000000..47ad26606a --- /dev/null +++ b/testsuites/libtests/dumpbuf01/dumpbuf01.doc @@ -0,0 +1,22 @@ +# +# $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: dumpbuf01 + +directives: + + rtems_print_buffer + +concepts: + ++ Fully exercise rtems_print_buffer and provide full coverage of all paths. diff --git a/testsuites/libtests/dumpbuf01/dumpbuf01.scn b/testsuites/libtests/dumpbuf01/dumpbuf01.scn new file mode 100644 index 0000000000..04c29e3df3 --- /dev/null +++ b/testsuites/libtests/dumpbuf01/dumpbuf01.scn @@ -0,0 +1,189 @@ +*** TEST DUMPBUF01 *** +====== Printing 0 Bytes ====== +=============================== + +====== Printing 1 Bytes ====== +41 |A | +=============================== + +====== Printing 2 Bytes ====== +41 42 |AB | +=============================== + +====== Printing 3 Bytes ====== +41 42 43 |ABC | +=============================== + +====== Printing 4 Bytes ====== +41 42 43 44 |ABCD | +=============================== + +====== Printing 5 Bytes ====== +41 42 43 44 45 |ABCDE | +=============================== + +====== Printing 6 Bytes ====== +41 42 43 44 45 46 |ABCDEF | +=============================== + +====== Printing 7 Bytes ====== +41 42 43 44 45 46 47 |ABCDEFG | +=============================== + +====== Printing 8 Bytes ====== +41 42 43 44 45 46 47 48 |ABCDEFGH | +=============================== + +====== Printing 9 Bytes ====== +41 42 43 44 45 46 47 48 49 |ABCDEFGHI | +=============================== + +====== Printing 10 Bytes ====== +41 42 43 44 45 46 47 48 49 4a |ABCDEFGHIJ | +=============================== + +====== Printing 11 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b |ABCDEFGHIJK | +=============================== + +====== Printing 12 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c |ABCDEFGHIJKL | +=============================== + +====== Printing 13 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d |ABCDEFGHIJKLM | +=============================== + +====== Printing 14 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e |ABCDEFGHIJKLMN | +=============================== + +====== Printing 15 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f |ABCDEFGHIJKLMNO | +=============================== + +====== Printing 16 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +=============================== + +====== Printing 17 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 |Q | +=============================== + +====== Printing 18 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 |QR | +=============================== + +====== Printing 19 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 |QRS | +=============================== + +====== Printing 20 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 |QRST | +=============================== + +====== Printing 21 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 |QRSTU | +=============================== + +====== Printing 22 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 |QRSTUV | +=============================== + +====== Printing 23 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 |QRSTUVW | +=============================== + +====== Printing 24 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 |QRSTUVWX | +=============================== + +====== Printing 25 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 |QRSTUVWXY | +=============================== + +====== Printing 26 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a |QRSTUVWXYZ | +=============================== + +====== Printing 27 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 |QRSTUVWXYZ0 | +=============================== + +====== Printing 28 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 |QRSTUVWXYZ01 | +=============================== + +====== Printing 29 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 |QRSTUVWXYZ012 | +=============================== + +====== Printing 30 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 |QRSTUVWXYZ0123 | +=============================== + +====== Printing 31 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 |QRSTUVWXYZ01234 | +=============================== + +====== Printing 32 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +=============================== + +====== Printing 33 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +36 |6 | +=============================== + +====== Printing 34 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +36 37 |67 | +=============================== + +====== Printing 35 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +36 37 38 |678 | +=============================== + +====== Printing 36 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +36 37 38 39 |6789 | +=============================== + +====== Printing 37 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +36 37 38 39 30 |67890 | +=============================== + +====== Printing 38 Bytes ====== +41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP| +51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345| +36 37 38 39 30 0a |67890. | +=============================== + +====== Printing -1 Bytes ====== + | | +=============================== + +*** END OF TEST DUMPBUF01 *** diff --git a/testsuites/libtests/dumpbuf01/init.c b/testsuites/libtests/dumpbuf01/init.c new file mode 100644 index 0000000000..c382bd2d0a --- /dev/null +++ b/testsuites/libtests/dumpbuf01/init.c @@ -0,0 +1,57 @@ +/* + * 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 + +unsigned char Buffer[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890\n"; + +void do_test( + int length +) +{ + printf( "====== Printing %d Bytes ======\n", length ); + rtems_print_buffer( Buffer, length ); + printf( "===============================\n\n" ); +} + +rtems_task Init( + rtems_task_argument argument +) +{ + int i; + + puts( "\n\n*** TEST DUMPBUF01 ***" ); + + for ( i = 0 ; i < sizeof(Buffer) ; i++ ) { + do_test( i ); + } + do_test( -1 ); + + puts( "*** END OF TEST DUMPBUF01 ***" ); + + rtems_test_exit(0); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT + +#include +/* end of file */ -- cgit v1.2.3