diff options
author | Gedare Bloom <gedare@rtems.org> | 2011-11-26 18:07:52 +0000 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2011-11-26 18:07:52 +0000 |
commit | b431b6635d15021f9f438db9d6fda36d7ae23e09 (patch) | |
tree | 3c5be97be4ee2ce9d0f14836f4089dafc345ffc3 /testsuites/sptests/spchain | |
parent | Regenerate. (diff) | |
download | rtems-b431b6635d15021f9f438db9d6fda36d7ae23e09.tar.bz2 |
2011-11-26 Gedare Bloom <gedare@rtems.org>
PR 1964
* spchain/init.c, spchain/spchain.scn: Add testcases for chain is first
and last
Diffstat (limited to 'testsuites/sptests/spchain')
-rw-r--r-- | testsuites/sptests/spchain/init.c | 20 | ||||
-rw-r--r-- | testsuites/sptests/spchain/spchain.scn | 2 |
2 files changed, 22 insertions, 0 deletions
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 |