summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2011-11-26 18:07:52 +0000
committerGedare Bloom <gedare@rtems.org>2011-11-26 18:07:52 +0000
commitb431b6635d15021f9f438db9d6fda36d7ae23e09 (patch)
tree3c5be97be4ee2ce9d0f14836f4089dafc345ffc3
parentRegenerate. (diff)
downloadrtems-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
-rw-r--r--testsuites/sptests/ChangeLog6
-rw-r--r--testsuites/sptests/spchain/init.c20
-rw-r--r--testsuites/sptests/spchain/spchain.scn2
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