summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-10-26 04:22:55 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-10-26 04:22:55 +0000
commit4cdce0e45a47b168608f7a14f85b82b34d861a7e (patch)
tree6e83baac194854f0db3b96bfea81836481c2dfcf /testsuites/sptests
parent2010-10-25 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-4cdce0e45a47b168608f7a14f85b82b34d861a7e.tar.bz2
2010-10-25 Joel Sherrill <joel.sherrill@oarcorp.com>
* spchain/init.c: Attempt to improve coverage.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/ChangeLog4
-rw-r--r--testsuites/sptests/spchain/init.c15
2 files changed, 18 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index d8e18e1934..9cda36bd7f 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-25 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * spchain/init.c: Attempt to improve coverage.
+
2010-10-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* spchain/init.c, spwatchdog/task1.c: Do not violate chain API.
diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c
index bd0ef5bc4d..9c853b772e 100644
--- a/testsuites/sptests/spchain/init.c
+++ b/testsuites/sptests/spchain/init.c
@@ -38,6 +38,7 @@ static void test_chain_with_notification(void)
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_control chain;
rtems_chain_node a;
+ rtems_chain_node b;
rtems_chain_node *p = (rtems_chain_node *) 1;
rtems_event_set out = 0;
@@ -59,8 +60,15 @@ static void test_chain_with_notification(void)
puts( "INIT - Verify rtems_chain_get_with_notification" );
rtems_chain_initialize_empty( &chain );
+
+ rtems_chain_append( &chain, &b );
rtems_chain_append( &chain, &a );
- sc = rtems_chain_get_with_notification( &chain, rtems_task_self(), EVENT, &p );
+
+ sc = rtems_chain_get_with_notification(&chain, rtems_task_self(), EVENT, &p);
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( p == &b );
+
+ sc = rtems_chain_get_with_notification(&chain, rtems_task_self(), EVENT, &p);
rtems_test_assert( sc == RTEMS_SUCCESSFUL );
rtems_test_assert( p == &a );
sc = rtems_event_receive(
@@ -94,9 +102,14 @@ static void test_chain_with_empty_check(void)
rtems_test_assert( empty );
empty = rtems_chain_prepend_with_empty_check( &chain, &a );
rtems_test_assert( !empty );
+ empty = rtems_chain_prepend_with_empty_check( &chain, &b );
+ rtems_test_assert( !empty );
puts( "INIT - Verify rtems_chain_get_with_empty_check" );
rtems_chain_initialize_empty( &chain );
+ empty = rtems_chain_get_with_empty_check( &chain, &p );
+ rtems_test_assert( empty );
+
rtems_chain_append( &chain, &a );
rtems_chain_append( &chain, &b );
empty = rtems_chain_get_with_empty_check( &chain, &p );