summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-12-21 09:50:15 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-12-21 15:40:27 +0100
commitcbd07e4ce0ede36bacf6920bd594579e931b1bdd (patch)
tree716aba4b883d92fe7a8aab8338dc783ba04d812d /testsuites
parentbsp/gen83xx: Add GPR_1 to register map (diff)
downloadrtems-cbd07e4ce0ede36bacf6920bd594579e931b1bdd.tar.bz2
score: Add rtems_chain_node_count_unprotected()
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/spchain/init.c22
-rw-r--r--testsuites/sptests/spchain/spchain.doc1
-rw-r--r--testsuites/sptests/spchain/spchain.scn1
3 files changed, 23 insertions, 1 deletions
diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c
index 00e2d778b6..f8d54b0fa4 100644
--- a/testsuites/sptests/spchain/init.c
+++ b/testsuites/sptests/spchain/init.c
@@ -136,7 +136,6 @@ static void test_chain_with_notification(void)
rtems_test_assert( sc == RTEMS_SUCCESSFUL );
rtems_test_assert( p == &a );
- puts( "INIT - Verify rtems_chain_prepend_with_notification" );
puts( "INIT - Verify rtems_chain_get_with_notification" );
rtems_chain_initialize_empty( &chain );
@@ -199,6 +198,26 @@ static void test_chain_with_empty_check(void)
rtems_test_assert( p == &b );
}
+static void test_chain_node_count(void)
+{
+ rtems_chain_control chain;
+ rtems_chain_node nodes[3];
+ size_t count;
+ size_t i;
+
+ puts( "INIT - Verify rtems_chain_node_count_unprotected" );
+
+ rtems_chain_initialize_empty( &chain );
+ count = rtems_chain_node_count_unprotected( &chain );
+ rtems_test_assert( count == 0 );
+
+ for (i = 0; i < RTEMS_ARRAY_SIZE( nodes ); ++i) {
+ rtems_chain_append_unprotected( &chain, &nodes[i] );
+ count = rtems_chain_node_count_unprotected( &chain );
+ rtems_test_assert( count == i + 1 );
+ }
+}
+
rtems_task Init(
rtems_task_argument ignored
)
@@ -240,6 +259,7 @@ rtems_task Init(
test_chain_get_with_wait();
test_chain_control_layout();
test_chain_control_initializer();
+ test_chain_node_count();
puts( "*** END OF RTEMS CHAIN API TEST ***" );
rtems_test_exit(0);
diff --git a/testsuites/sptests/spchain/spchain.doc b/testsuites/sptests/spchain/spchain.doc
index 119d42baeb..29c9d1045c 100644
--- a/testsuites/sptests/spchain/spchain.doc
+++ b/testsuites/sptests/spchain/spchain.doc
@@ -23,6 +23,7 @@ directives:
rtems_chain_prepend_with_notification
rtems_chain_get_with_notification
rtems_chain_get_with_wait
+ rtems_chain_node_count_unprotected
concepts:
diff --git a/testsuites/sptests/spchain/spchain.scn b/testsuites/sptests/spchain/spchain.scn
index 4b06949bf6..9cf4d5212f 100644
--- a/testsuites/sptests/spchain/spchain.scn
+++ b/testsuites/sptests/spchain/spchain.scn
@@ -12,4 +12,5 @@ INIT - Verify rtems_chain_get_with_notification
INIT - Verify rtems_chain_get_with_wait
INIT - Verify rtems_chain_control layout
INIT - Verify rtems_chain_control initializer
+INIT - Verify rtems_chain_node_count_unprotected
*** END OF RTEMS CHAIN API TEST ***