3 //=============================================================================
7 * Header file for a test to verify and illustrate the use of the
8 * ACE_RB_Tree ACE_RB_Tree_Iterator, and
9 * ACE_RB_Tree_Reverse_Iterator classes.
12 * @author Chris Gill <cdgill@cs.wustl.edu>
14 //=============================================================================
18 * @class ACE_RB_Tree_Test
20 * @brief Implements a templatized test class for the RB_Tree ADT and its
23 template <class EXT_ID
, class INT_ID
, class COMPARE_KEYS
, class ACE_LOCK
>
24 class ACE_RB_Tree_Test
26 // To run the test class on a particular type instantiation of the
27 // RB_Tree, simply instantiate the test class template with the
28 // same type parameters, and invoke the run_test method.
32 typedef ACE_RB_Tree
<EXT_ID
, INT_ID
, COMPARE_KEYS
, ACE_LOCK
>
34 typedef ACE_RB_Tree_Iterator
<EXT_ID
, INT_ID
, COMPARE_KEYS
, ACE_LOCK
>
36 typedef ACE_RB_Tree_Reverse_Iterator
<EXT_ID
, INT_ID
, COMPARE_KEYS
, ACE_LOCK
>
40 ACE_RB_Tree_Test (int entry_count
,
48 /// Run the individual interface and iteration tests in order.
52 /// Tests stable and deprecated insertion interfaces.
53 void test_tree_insertion ();
55 /// Tests forward and reverse iteration after insertion in both
57 void test_post_insertion_iteration ();
59 ///Tests forward and reverse partial iteration
60 void test_partial_iteration();
62 /// Tests stable and deprecated deletion interfaces.
63 void test_tree_deletion ();
65 /// Tests forward and reverse iteration after deletions in both
67 void test_post_deletion_iteration ();
69 /// Tree for testing stable interface.
72 /// Forward iterator for tree for testing stable interface.
73 ITERATOR stable_fwd_iter_
;
75 ITERATOR part_fwd_iter_
;
77 REVERSE_ITERATOR part_rev_iter_
;
79 /// Forward iterator for tree for testing stable interface.
80 REVERSE_ITERATOR stable_rev_iter_
;
82 /// Tree for testing deprecated interface.
83 TREE deprecated_tree_
;
85 /// Forward iterator for tree for testing deprecated interface.
86 ITERATOR deprecated_fwd_iter_
;
88 /// Forward iterator for tree for testing deprecated interface.
89 REVERSE_ITERATOR deprecated_rev_iter_
;
91 /// Number of entries in the key, item, and index arrays.
94 /// Array of EXT_IDs (keys) with which to test.
97 /// Array of INT_IDs (items) with which to test.
100 /// Order of indices in the key and item arrays.