summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-14 23:17:48 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-07-14 23:17:48 +0000
commitba959a4b1cac2df4f3530518bdd16868f078010c (patch)
tree7a5faabcc181bc870edba256e356b676965069d1 /testsuites/sptests
parent2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-ba959a4b1cac2df4f3530518bdd16868f078010c.tar.bz2
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* spprintk/init.c, spprintk/spprintk.doc, spprintk/spprintk.scn: Clean up and add test of getchark().
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/ChangeLog5
-rw-r--r--testsuites/sptests/spprintk/init.c54
-rw-r--r--testsuites/sptests/spprintk/spprintk.doc6
-rw-r--r--testsuites/sptests/spprintk/spprintk.scn6
4 files changed, 61 insertions, 10 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index dcd4983883..5c665caad0 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,5 +1,10 @@
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * spprintk/init.c, spprintk/spprintk.doc, spprintk/spprintk.scn: Clean
+ up and add test of getchark().
+
+2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* spfatal21/Makefile.am: Fix typo.
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
diff --git a/testsuites/sptests/spprintk/init.c b/testsuites/sptests/spprintk/init.c
index 2135412c65..8ff4711652 100644
--- a/testsuites/sptests/spprintk/init.c
+++ b/testsuites/sptests/spprintk/init.c
@@ -1,7 +1,7 @@
/*
- * Exercise Printk
+ * Exercise putk, printk, and getchark
*
- * COPYRIGHT (c) 1989-2009.
+ * COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -12,15 +12,41 @@
*/
#include <tmacros.h>
+#include <rtems/bspIo.h>
-rtems_task Init(
- rtems_task_argument argument
-)
+int test_getchar(void)
{
- printk( "\n\n*** TEST PRINTK ***\n" );
+ return 0x35;
+}
+
+void do_getchark(void)
+{
+ int sc;
+ BSP_polling_getchar_function_type poll_char;
+
+ poll_char = BSP_poll_char;
+
+ BSP_poll_char = NULL;
+
+ putk( "getchark - NULL getchar method - return -1" );
+ sc = getchark();
+ rtems_test_assert( sc == -1 );
+
+ putk( "getchark - test getchar method - returns 0x35" );
+ BSP_poll_char = test_getchar;
+ sc = getchark();
+ rtems_test_assert( sc == 0x35 );
+
+ BSP_poll_char = poll_char;
+}
- putk( "This is a test of putk\n" );
+void do_putk(void)
+{
+ putk( "This is a test of putk" );
+}
+void do_printk(void)
+{
printk( "bad format -- %%q in parentheses (%q)\n" );
printk( "bad format -- %%lq in parentheses (%lq)\n", 0x1234 );
@@ -52,7 +78,21 @@ rtems_task Init(
printk( "%%-12s of joel -- (%-20s)\n", "joel" );
printk( "%%-4s of joel -- (%-4s)\n", "joel" );
printk( "%%c of X -- (%c)\n", 'X' );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ printk( "\n\n*** TEST PRINTK ***\n" );
+
+ do_putk();
+ putk("");
+
+ do_printk();
+ putk("");
+ do_getchark();
printk( "*** END OF TEST PRINTK ***\n" );
rtems_test_exit( 0 );
diff --git a/testsuites/sptests/spprintk/spprintk.doc b/testsuites/sptests/spprintk/spprintk.doc
index 84020d6d14..070dd01129 100644
--- a/testsuites/sptests/spprintk/spprintk.doc
+++ b/testsuites/sptests/spprintk/spprintk.doc
@@ -15,8 +15,14 @@ test set name: spprintk
directives:
+ putk
printk
+ getchark
concepts:
++ Ensure that putk() is fully exercised and operates as expected.
+
+ Ensure that printk() is fully exercised and operates as expected.
+
++ Ensure that getchark() is fully exercised and operates as expected.
diff --git a/testsuites/sptests/spprintk/spprintk.scn b/testsuites/sptests/spprintk/spprintk.scn
index ad58614679..52ca4834c4 100644
--- a/testsuites/sptests/spprintk/spprintk.scn
+++ b/testsuites/sptests/spprintk/spprintk.scn
@@ -1,6 +1,3 @@
-sparc-rtems4.10-run is /opt/rtems-4.10/bin/sparc-rtems4.10-run
-
-
*** TEST PRINTK ***
This is a test of putk
@@ -28,4 +25,7 @@ bad format -- %lq in parentheses (q)
%-12s of joel -- (joel )
%-4s of joel -- (joel)
%c of X -- (X)
+
+getchark - NULL getchar method - return -1
+getchark - test getchar method - returns 0x35
*** END OF TEST PRINTK ***