Ignore:
Timestamp:
Aug 26, 2013, 12:27:52 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
58a5889
Parents:
d56f76a
git-author:
Sebastian Huber <sebastian.huber@…> (08/26/13 12:27:52)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/27/13 08:48:16)
Message:

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().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/spchain/init.c

    rd56f76a r23de794d  
    2626} test_node;
    2727
     28static rtems_chain_control one_node_chain;
     29
     30static rtems_chain_node node_of_one_node_chain =
     31  RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( &one_node_chain );
     32
     33static rtems_chain_control one_node_chain =
     34  RTEMS_CHAIN_INITIALIZER_ONE_NODE( &node_of_one_node_chain );
     35
    2836static void test_chain_control_initializer(void)
    2937{
    3038  rtems_chain_control chain = RTEMS_CHAIN_INITIALIZER_EMPTY( chain );
     39
    3140  puts( "INIT - Verify rtems_chain_control initializer" );
     41
    3242  rtems_test_assert( rtems_chain_is_empty( &chain ) );
     43
     44  rtems_test_assert( rtems_chain_has_only_one_node( &one_node_chain ) );
     45  rtems_test_assert(
     46    rtems_chain_immutable_first( &one_node_chain ) == &node_of_one_node_chain
     47  );
     48  rtems_test_assert(
     49    rtems_chain_immutable_last( &one_node_chain ) == &node_of_one_node_chain
     50  );
     51  rtems_test_assert(
     52    rtems_chain_immutable_head( &one_node_chain )
     53      == rtems_chain_immutable_previous( &node_of_one_node_chain )
     54  );
     55  rtems_test_assert(
     56    rtems_chain_immutable_tail( &one_node_chain )
     57      == rtems_chain_immutable_next( &node_of_one_node_chain )
     58  );
    3359}
    3460
Note: See TracChangeset for help on using the changeset viewer.