diff options
-rw-r--r-- | testsuites/sptests/ChangeLog | 6 | ||||
-rw-r--r-- | testsuites/sptests/spchain/init.c | 20 | ||||
-rw-r--r-- | testsuites/sptests/spchain/spchain.scn | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index 39bcef7bd1..372665b1a7 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,3 +1,9 @@ +2011-11-26 Gedare Bloom <gedare@rtems.org> + + PR 1964 + * spchain/init.c, spchain/spchain.scn: Add testcases for chain is first + and last + 2011-11-10 Sebastian Huber <sebastian.huber@embedded-brains.de> PR 1924/cpukit diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c index 42044472ed..494ebdf08a 100644 --- a/testsuites/sptests/spchain/init.c +++ b/testsuites/sptests/spchain/init.c @@ -59,6 +59,25 @@ static void test_chain_get_with_wait(void) rtems_test_assert( p == NULL ); } +static void test_chain_first_and_last(void) +{ + rtems_chain_control chain; + rtems_chain_node node1, node2; + rtems_chain_node *cnode; + + rtems_chain_initialize_empty( &chain ); + rtems_chain_append( &chain, &node1 ); + rtems_chain_insert( &node1, &node2 ); + + puts( "INIT - Verify rtems_chain_is_first" ); + cnode = rtems_chain_first(&chain); + rtems_test_assert( rtems_chain_is_first( cnode ) ); + + puts( "INIT - Verify rtems_chain_is_last" ); + cnode = rtems_chain_last(&chain); + rtems_test_assert( rtems_chain_is_last( cnode ) ); +} + static void test_chain_with_notification(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; @@ -214,6 +233,7 @@ rtems_task Init( } } + test_chain_first_and_last(); test_chain_with_empty_check(); test_chain_with_notification(); test_chain_get_with_wait(); diff --git a/testsuites/sptests/spchain/spchain.scn b/testsuites/sptests/spchain/spchain.scn index 45db01f773..4b06949bf6 100644 --- a/testsuites/sptests/spchain/spchain.scn +++ b/testsuites/sptests/spchain/spchain.scn @@ -1,6 +1,8 @@ *** TEST OF RTEMS CHAIN API *** Init - Initialize chain empty INIT - Verify rtems_chain_insert +INIT - Verify rtems_chain_is_first +INIT - Verify rtems_chain_is_last INIT - Verify rtems_chain_append_with_empty_check INIT - Verify rtems_chain_prepend_with_empty_check INIT - Verify rtems_chain_get_with_empty_check |