From b431b6635d15021f9f438db9d6fda36d7ae23e09 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Sat, 26 Nov 2011 18:07:52 +0000 Subject: 2011-11-26 Gedare Bloom PR 1964 * spchain/init.c, spchain/spchain.scn: Add testcases for chain is first and last --- testsuites/sptests/ChangeLog | 6 ++++++ testsuites/sptests/spchain/init.c | 20 ++++++++++++++++++++ testsuites/sptests/spchain/spchain.scn | 2 ++ 3 files changed, 28 insertions(+) (limited to 'testsuites/sptests') 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 + + PR 1964 + * spchain/init.c, spchain/spchain.scn: Add testcases for chain is first + and last + 2011-11-10 Sebastian Huber 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 -- cgit v1.2.3