summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spchain
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-26 14:27:52 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-27 10:48:16 +0200
commit23de794d15f88845ee04f800387123856303c036 (patch)
treef570c3c996c002a7ef334f78430c805e03ed13c2 /testsuites/sptests/spchain
parentbsps: Fix header includes (diff)
downloadrtems-23de794d15f88845ee04f800387123856303c036.tar.bz2
score: Add and use CHAIN_INITIALIZER_ONE_NODE().
Add and use CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(), RTEMS_CHAIN_INITIALIZER_ONE_NODE() and RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN().
Diffstat (limited to 'testsuites/sptests/spchain')
-rw-r--r--testsuites/sptests/spchain/init.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c
index 72895b6748..219d0f3b52 100644
--- a/testsuites/sptests/spchain/init.c
+++ b/testsuites/sptests/spchain/init.c
@@ -25,11 +25,37 @@ typedef struct {
int id;
} test_node;
+static rtems_chain_control one_node_chain;
+
+static rtems_chain_node node_of_one_node_chain =
+ RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( &one_node_chain );
+
+static rtems_chain_control one_node_chain =
+ RTEMS_CHAIN_INITIALIZER_ONE_NODE( &node_of_one_node_chain );
+
static void test_chain_control_initializer(void)
{
rtems_chain_control chain = RTEMS_CHAIN_INITIALIZER_EMPTY( chain );
+
puts( "INIT - Verify rtems_chain_control initializer" );
+
rtems_test_assert( rtems_chain_is_empty( &chain ) );
+
+ rtems_test_assert( rtems_chain_has_only_one_node( &one_node_chain ) );
+ rtems_test_assert(
+ rtems_chain_immutable_first( &one_node_chain ) == &node_of_one_node_chain
+ );
+ rtems_test_assert(
+ rtems_chain_immutable_last( &one_node_chain ) == &node_of_one_node_chain
+ );
+ rtems_test_assert(
+ rtems_chain_immutable_head( &one_node_chain )
+ == rtems_chain_immutable_previous( &node_of_one_node_chain )
+ );
+ rtems_test_assert(
+ rtems_chain_immutable_tail( &one_node_chain )
+ == rtems_chain_immutable_next( &node_of_one_node_chain )
+ );
}
static void test_chain_control_layout(void)