1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5<head> 6 <meta name="generator" content= 7 "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" /> 8 9 <title>Associative-Container Regression Tests</title> 10 <meta http-equiv="Content-Type" content= 11 "text/html; charset=us-ascii" /> 12<base href="http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/testsuite/ext/pb_ds/regression/"> 13 </head> 14 15<body> 16 <div id="page"> 17 <h1>Associative-Container Regression Tests</h1> 18 19 <h2><a name="assoc_desc" id="assoc_desc">Description</a></h2> 20 21 <p>The library contains a single comprehensive regression test. 22 For a given container type in <tt>pb_ds</tt>, the test creates 23 an object of the container type and an object of the 24 corresponding STL type (<i>e.g.</i>, <tt>std::set</tt>). It 25 then performs a random sequence of methods with random 26 arguments (<i>e.g.</i>, inserts, erases, and so forth) on both 27 objects. At each operation, the test checks the return value of 28 the method, and optionally both compares <tt>pb_ds</tt>'s 29 object with the STL's object as well as performing other 30 consistency checks on <tt>pb_ds</tt>'s object (<i>e.g.</i>, 31 order preservation, when applicable, or node invariants, when 32 applicable).</p> 33 34 <p>Additionally, the test integrally checks exception safety 35 and resource leaks. This is done as follows. A special 36 allocator type, written for the purpose of the test, both 37 randomly throws an exceptions when allocations are performed, 38 and tracks allocations and de-allocations. The exceptions thrown 39 at allocations simulate memory-allocation failures; the 40 tracking mechanism checks for memory-related bugs (<i>e.g.</i>, 41 resource leaks and multiple de-allocations). Both 42 <tt>pb_ds</tt>'s containers and the containers' value-types are 43 configured to use this allocator.</p> 44 45 <p>Due to compiler constraints, the test is split into the 46 several sources, each checking only some containers.</p> 47 48 <h2><a name="assoc_tests" id="assoc_tests">Tests</a></h2> 49 50 <h3><a name="assoc_tests_set" id="assoc_tests_set">"Set" 51 Tests</a></h3> 52 53 <p>The following check all "set" types:</p> 54 55 <ol> 56 <li><a href= 57 "hash_no_data_map_rand.cc"><tt>hash_no_data_map_rand.cc</tt></a> 58 checks all hash-based "set" types.</li> 59 60 <li><a href= 61 "list_update_no_data_map_rand.cc"><tt>list_update_no_data_map_rand.cc</tt></a> 62 checks all list-based "set" types.</li> 63 64 <li><a href= 65 "tree_no_data_map_rand.cc"><tt>tree_no_data_map_rand.cc</tt></a> 66 checks all tree-based "set" types.</li> 67 68 <li><a href= 69 "trie_no_data_map_rand.cc"><tt>trie_no_data_map_rand.cc</tt></a> 70 checks all PATRICIA-trie-based "set" types.</li> 71 </ol> 72 73 <h3><a name="assoc_tests_map" id="assoc_tests_map">"Map" 74 Tests</a></h3> 75 76 <p>The following check all "map" types:</p> 77 78 <ol> 79 <li><a href= "hash_data_map_rand.cc"><tt>hash_data_map_rand.cc</tt></a> 80 checks all hash-based "map" types.</li> 81 82 <li><a href= "list_update_data_map_rand.cc"><tt>list_update_data_map_rand.cc</tt></a> 83 checks all list-based "map" types.</li> 84 85 <li><a href= "tree_data_map_rand.cc"><tt>tree_data_map_rand.cc</tt></a> 86 checks all tree-based "map" types.</li> 87 88 <li><a href= "trie_data_map_rand.cc"><tt>trie_data_map_rand.cc</tt></a> 89 checks all PATRICIA-trie-based "map" types.</li> 90 </ol> 91 </div> 92</body> 93</html> 94