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
27 // To run the test class on a particular type instantiation of the
28 // RB_Tree, simply instantiate the test class template with the
29 // same type parameters, and invoke the run_test method.
33 typedef ACE_RB_Tree
<EXT_ID
, INT_ID
, COMPARE_KEYS
, ACE_LOCK
>
35 typedef ACE_RB_Tree_Iterator
<EXT_ID
, INT_ID
, COMPARE_KEYS
, ACE_LOCK
>
37 typedef ACE_RB_Tree_Reverse_Iterator
<EXT_ID
, INT_ID
, COMPARE_KEYS
, ACE_LOCK
>
41 ACE_RB_Tree_Test (int entry_count
,
47 ~ACE_RB_Tree_Test (void);
49 /// Run the individual interface and iteration tests in order.
54 /// Tests stable and deprecated insertion interfaces.
55 void test_tree_insertion (void);
57 /// Tests forward and reverse iteration after insertion in both
59 void test_post_insertion_iteration (void);
61 ///Tests forward and reverse partial iteration
62 void test_partial_iteration(void);
64 /// Tests stable and deprecated deletion interfaces.
65 void test_tree_deletion (void);
67 /// Tests forward and reverse iteration after deletions in both
69 void test_post_deletion_iteration (void);
71 /// Tree for testing stable interface.
74 /// Forward iterator for tree for testing stable interface.
75 ITERATOR stable_fwd_iter_
;
77 ITERATOR part_fwd_iter_
;
79 REVERSE_ITERATOR part_rev_iter_
;
81 /// Forward iterator for tree for testing stable interface.
82 REVERSE_ITERATOR stable_rev_iter_
;
84 /// Tree for testing deprecated interface.
85 TREE deprecated_tree_
;
87 /// Forward iterator for tree for testing deprecated interface.
88 ITERATOR deprecated_fwd_iter_
;
90 /// Forward iterator for tree for testing deprecated interface.
91 REVERSE_ITERATOR deprecated_rev_iter_
;
93 /// Number of entries in the key, item, and index arrays.
96 /// Array of EXT_IDs (keys) with which to test.
99 /// Array of INT_IDs (items) with which to test.
102 /// Order of indices in the key and item arrays.