summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-07 22:48:50 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-07 22:48:50 +0000
commit2b31bec458e53ecde8c29b7cf2050492f6590152 (patch)
tree247a242e2b4ff36868d072acef436c650d7340bf /libstdc++-v3/testsuite
parent67bb1301893570172e9997b9f2242385eddf4f56 (diff)
downloadppe42-gcc-2b31bec458e53ecde8c29b7cf2050492f6590152.tar.gz
ppe42-gcc-2b31bec458e53ecde8c29b7cf2050492f6590152.zip
2006-09-08 Benjamin Kosnik <bkoz@redhat.com>
* include/debug/debug.h (_GLIBCXX_DEBUG_ONLY): New. * include/ext/bitmap_allocator.h (_BALLOC_SANITY_CHECK, _BALLOC_ASSERT): Remove. Use _GLIBCXX_DEBUG, _GLIBCXX_DEBUG_ASSERT. * include/ext/pb_ds/hash_policy.hpp (PB_DS_DBG_ASSERT): Convert to _GLIBCXX_DEBUG_ASSERT. Formatting corrections. (PB_DS_DBG_VERIFY): Remove, unused. (PB_DS_DBG_ONLY): Convert to _GLIBCXX_DEBUG blocks. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ binomial_heap_base_.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/unordered_iterator/iterator.hpp: Same. * include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp: Same. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/head.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/leaf.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/node_base.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ erase_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ insert_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ insert_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ debug_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ debug_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/types_traits.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp: Same. * include/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ left_child_next_sibling_heap_.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp: Same. * include/ext/pb_ds/detail/map_debug_base.hpp: Same. * include/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp: Same. * include/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp: Same. * include/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/ rc_binomial_heap_.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/ split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp: Same. * testsuite/util/regression/res_mng/forced_exception.hpp: Same. * testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp: Same. * testsuite/util/regression/res_mng/dbg_ex_allocator.hpp: Same. * testsuite/util/rng/twister_rand_gen.cc * testsuite/util/native_type/assoc/native_multimap.hpp: Same. * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp27
-rw-r--r--libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp26
-rw-r--r--libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator.hpp129
-rw-r--r--libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp52
-rw-r--r--libstdc++-v3/testsuite/util/regression/res_mng/forced_exception.hpp4
-rw-r--r--libstdc++-v3/testsuite/util/rng/twister_rand_gen.cc23
6 files changed, 51 insertions, 210 deletions
diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp
index 65b3c8d8270..937cc6735df 100644
--- a/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_hash_multimap.hpp
@@ -59,16 +59,6 @@ namespace pb_ds
namespace test
{
-#ifdef NATIVE_HASH_MULTIMAP_DEBUG
-#define PB_DS_DBG_ASSERT(X) assert(X)
-#define PB_DS_DBG_VERIFY(X) assert(X)
-#define PB_DS_DBG_ONLY(X) X
-#else // #ifdef NATIVE_HASH_MULTIMAP_DEBUG
-#define PB_DS_DBG_ASSERT(X)
-#define PB_DS_DBG_VERIFY(X) {if((X)==0);}
-#define PB_DS_DBG_ONLY(X) ;
-#endif // #ifdef NATIVE_HASH_MULTIMAP_DEBUG
-
#define PB_DS_CLASS_T_DEC \
template< \
typename Key, \
@@ -216,36 +206,25 @@ namespace pb_ds
static std::string
desc()
{
- return (make_xml_tag( "type", "value", "__gnucxx_hash_multimap"));
+ return (make_xml_tag("type", "value", "__gnucxx_hash_multimap"));
}
};
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
- native_hash_multimap()
-#ifdef __GNUC__
- :
- base_type(Init_Size)
-#endif // #ifdef __GNUC__
+ native_hash_multimap() : base_type(Init_Size)
{ }
PB_DS_CLASS_T_DEC
template<typename It>
PB_DS_CLASS_C_DEC::
- native_hash_multimap(It f, It l) :
- base_type(f, l)
+ native_hash_multimap(It f, It l) : base_type(f, l)
{ }
#undef PB_DS_CLASS_T_DEC
-
#undef PB_DS_CLASS_C_DEC
-
#undef PB_DS_BASE_C_DEC
-#undef PB_DS_DBG_ASSERT
-#undef PB_DS_DBG_VERIFY
-#undef PB_DS_DBG_ONLY
-
} // namespace test
} // namespace pb_ds
diff --git a/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp b/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp
index f428ca8cdea..42b9766e3c7 100644
--- a/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/assoc/native_multimap.hpp
@@ -57,16 +57,6 @@ namespace pb_ds
namespace test
{
-#ifdef NATIVE_HASH_SET_DEBUG
-#define PB_DS_DBG_ASSERT(X) assert(X)
-#define PB_DS_DBG_VERIFY(X) assert(X)
-#define PB_DS_DBG_ONLY(X) X
-#else // #ifdef NATIVE_HASH_SET_DEBUG
-#define PB_DS_DBG_ASSERT(X)
-#define PB_DS_DBG_VERIFY(X) {if((X)==0);}
-#define PB_DS_DBG_ONLY(X) ;
-#endif // #ifdef NATIVE_HASH_SET_DEBUG
-
#define PB_DS_CLASS_T_DEC \
template<typename Key, typename Data, class Less_Fn, class Allocator>
@@ -155,7 +145,6 @@ namespace pb_ds
{
if (it->second == r_val.second)
return it;
-
++it;
}
@@ -179,7 +168,6 @@ namespace pb_ds
{
if (it->second == r_val.second)
return it;
-
++it;
}
@@ -198,7 +186,7 @@ namespace pb_ds
static std::string
desc()
{
- return (make_xml_tag( "type", "value", "std_multimap"));
+ return (make_xml_tag("type", "value", "std_multimap"));
}
};
@@ -210,21 +198,13 @@ namespace pb_ds
PB_DS_CLASS_T_DEC
template<typename It>
PB_DS_CLASS_C_DEC::
- native_multimap(It f, It l) :
- base_type(f, l)
+ native_multimap(It f, It l) : base_type(f, l)
{ }
#undef PB_DS_CLASS_T_DEC
-
#undef PB_DS_CLASS_C_DEC
-
#undef PB_DS_BASE_C_DEC
-
-#undef PB_DS_DBG_ASSERT
-#undef PB_DS_DBG_VERIFY
-#undef PB_DS_DBG_ONLY
-
- } // namespace test
+} // namespace test
} // namespace pb_ds
diff --git a/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator.hpp b/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator.hpp
index eedce6bed01..53072db887b 100644
--- a/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator.hpp
+++ b/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator.hpp
@@ -51,17 +51,8 @@
namespace pb_ds
{
-
namespace test
{
-
-#define PB_DS_CLASS_T_DEC \
- template<typename T>
-
-#define PB_DS_CLASS_C_DEC \
- dbg_ex_allocator< \
- T>
-
template<typename T>
class dbg_ex_allocator : public detail::dbg_ex_allocator_base
{
@@ -80,127 +71,59 @@ namespace pb_ds
typedef dbg_ex_allocator<U> other;
};
- dbg_ex_allocator() throw();
+ dbg_ex_allocator() throw() { }
- dbg_ex_allocator(const PB_DS_CLASS_C_DEC& ) throw();
+ dbg_ex_allocator(const dbg_ex_allocator<T>& ) throw() { }
template <class U>
- dbg_ex_allocator(const dbg_ex_allocator<U>& ) throw();
+ dbg_ex_allocator(const dbg_ex_allocator<U>& ) throw() { }
- ~dbg_ex_allocator() throw();
+ ~dbg_ex_allocator() throw() { }
size_type
- max_size() const throw();
+ max_size() const throw()
+ { return std::allocator<T>().max_size(); }
pointer
allocate(size_type num, std::allocator<void>::const_pointer hint = 0);
void
- construct(pointer p, const T& r_val);
+ construct(pointer p, const T& r_val)
+ { return std::allocator<T>().construct(p, r_val); }
void
- destroy(pointer p);
+ destroy(pointer p)
+ { std::allocator<T>().destroy(p); }
void
- deallocate(pointer p, size_type num);
+ deallocate(pointer p, size_type num)
+ {
+ erase(p, sizeof(T) * num);
+ std::allocator<T>().deallocate(p, num);
+ }
void
- check_allocated(pointer p, size_type num);
+ check_allocated(pointer p, size_type num)
+ { detail::dbg_ex_allocator_base::check_allocated(p, sizeof(T) * num); }
};
- PB_DS_CLASS_T_DEC
- inline bool
- operator==(const PB_DS_CLASS_C_DEC& , const PB_DS_CLASS_C_DEC& );
-
- PB_DS_CLASS_T_DEC
- PB_DS_CLASS_C_DEC::
- dbg_ex_allocator() throw()
- { }
-
- PB_DS_CLASS_T_DEC
- PB_DS_CLASS_C_DEC::
- dbg_ex_allocator(const PB_DS_CLASS_C_DEC& ) throw()
- { }
-
- PB_DS_CLASS_T_DEC
- template<typename U>
- PB_DS_CLASS_C_DEC::
- dbg_ex_allocator(const dbg_ex_allocator<U>& ) throw()
- { }
-
- PB_DS_CLASS_T_DEC
- PB_DS_CLASS_C_DEC::
- ~dbg_ex_allocator() throw()
- { }
-
- PB_DS_CLASS_T_DEC
- typename PB_DS_CLASS_C_DEC::size_type
- PB_DS_CLASS_C_DEC::
- max_size() const throw()
- {
- return (std::allocator<T>().max_size());
- }
-
- PB_DS_CLASS_T_DEC
- typename PB_DS_CLASS_C_DEC::pointer
- PB_DS_CLASS_C_DEC::
+ template<typename T>
+ typename dbg_ex_allocator<T>::pointer
+ dbg_ex_allocator<T>::
allocate(size_type num, std::allocator<void>::const_pointer hint/*= 0*/)
{
cond_throw();
-
T* const a_t = std::allocator<T>().allocate(num, hint);
-
- insert(a_t, sizeof(T)* num);
-
- return (a_t);
- }
-
- PB_DS_CLASS_T_DEC
- void
- PB_DS_CLASS_C_DEC::
- construct(pointer p, const T& r_val)
- {
- return (std::allocator<T>().construct(p, r_val));
- }
-
- PB_DS_CLASS_T_DEC
- void
- PB_DS_CLASS_C_DEC::
- destroy(pointer p)
- {
- std::allocator<T>().destroy(p);
- }
-
- PB_DS_CLASS_T_DEC
- void
- PB_DS_CLASS_C_DEC::
- deallocate(pointer p, size_type num)
- {
- erase(p, sizeof(T)* num);
-
- std::allocator<T>().deallocate(p, num);
+ insert(a_t, sizeof(T) * num);
+ return a_t;
}
- PB_DS_CLASS_T_DEC
- void
- PB_DS_CLASS_C_DEC::
- check_allocated(pointer p, size_type num)
- {
- detail::dbg_ex_allocator_base::check_allocated(p, sizeof(T)* num);
- }
-
- PB_DS_CLASS_T_DEC
+ template<typename T>
inline bool
- operator==(const PB_DS_CLASS_C_DEC& , const PB_DS_CLASS_C_DEC& )
- {
- return (true);
- }
-
-#undef PB_DS_CLASS_T_DEC
-#undef PB_DS_CLASS_C_DEC
+ operator==(const dbg_ex_allocator<T>& , const dbg_ex_allocator<T>& )
+ { return true; }
} // namespace test
-
} // namespace pb_ds
-#endif // #ifndef PB_DS_DBG_EX_ALLOCATOR_HPP
+#endif
diff --git a/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp b/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp
index caedd36aa52..9831281e3f1 100644
--- a/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp
+++ b/libstdc++-v3/testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp
@@ -57,13 +57,10 @@
namespace pb_ds
{
-
namespace test
{
-
namespace detail
{
-
class dbg_ex_allocator_base;
std::ostream&
@@ -96,14 +93,11 @@ namespace pb_ds
group_throw_prob_adjustor(size_t size) : m_orig_throw_prob(s_throw_prob)
{
s_throw_prob =
- 1 - ::pow((double)(
- 1 - s_throw_prob),(double)(0.5 / (size + 1)));
+ 1 - ::pow(double(1 - s_throw_prob), double(0.5 / (size + 1)));
}
~group_throw_prob_adjustor()
- {
- s_throw_prob = m_orig_throw_prob;
- }
+ { s_throw_prob = m_orig_throw_prob; }
private:
const double m_orig_throw_prob;
@@ -113,14 +107,10 @@ namespace pb_ds
{
public:
zero_throw_prob_adjustor() : m_orig_throw_prob(s_throw_prob)
- {
- s_throw_prob = 0;
- }
+ { s_throw_prob = 0; }
~zero_throw_prob_adjustor()
- {
- s_throw_prob = m_orig_throw_prob;
- }
+ { s_throw_prob = m_orig_throw_prob; }
private:
const double m_orig_throw_prob;
@@ -143,17 +133,12 @@ namespace pb_ds
check_allocated(void* p_r, size_t size);
private:
- typedef std::pair< label, size_t> alloc_data_t;
-
- typedef std::map< void* , alloc_data_t> map_t;
-
- typedef map_t::value_type entry_t;
-
- typedef map_t::const_iterator const_iterator;
+ typedef std::pair<label, size_t> alloc_data_t;
+ typedef std::map<void*, alloc_data_t> map_t;
+ typedef map_t::value_type entry_t;
+ typedef map_t::const_iterator const_iterator;
+ typedef map_t::const_reference const_reference;
- typedef map_t::const_reference const_reference;
-
- private:
static void
print_to_ostream(std::ostream& r_os);
@@ -163,25 +148,16 @@ namespace pb_ds
static entry_t
make_entry(void* p_r, size_t size);
- private:
static twister_rand_gen s_g;
+ static map_t s_map;
+ static double s_throw_prob;
+ static size_t s_label;
- static map_t s_map;
-
- static double s_throw_prob;
-
- static size_t s_label;
-
- friend std::ostream& operator<<(std::ostream& r_os, const dbg_ex_allocator_base& r_dbg);
+ friend std::ostream& operator<<(std::ostream& r_os,
+ const dbg_ex_allocator_base& r_dbg);
};
-
- std::ostream&
- operator<<(std::ostream& r_os, const dbg_ex_allocator_base& r_dbg);
-
} // namespace detail
-
} // namespace test
-
} // namespace pb_ds
#endif // #ifndef PB_DS_DBG_EX_ALLOCATOR_BASE_HPP
diff --git a/libstdc++-v3/testsuite/util/regression/res_mng/forced_exception.hpp b/libstdc++-v3/testsuite/util/regression/res_mng/forced_exception.hpp
index a46ad2c0604..36942033139 100644
--- a/libstdc++-v3/testsuite/util/regression/res_mng/forced_exception.hpp
+++ b/libstdc++-v3/testsuite/util/regression/res_mng/forced_exception.hpp
@@ -49,15 +49,11 @@
namespace pb_ds
{
-
namespace test
{
-
struct forced_exception
{ };
-
} // namespace test
-
} // namespace pb_ds
#endif // #ifndef PB_DS_FORCED_EXCEPTION_HPP
diff --git a/libstdc++-v3/testsuite/util/rng/twister_rand_gen.cc b/libstdc++-v3/testsuite/util/rng/twister_rand_gen.cc
index 2163eb704fb..879844a0259 100644
--- a/libstdc++-v3/testsuite/util/rng/twister_rand_gen.cc
+++ b/libstdc++-v3/testsuite/util/rng/twister_rand_gen.cc
@@ -43,23 +43,14 @@
* @file twister_rand_gen.cc
*/
-#include <util/rng/twister_rand_gen.hpp>
#include <ctime>
+#include <debug/debug.h>
+#include <util/rng/twister_rand_gen.hpp>
namespace pb_ds
{
namespace test
{
-#ifdef PB_DS_TWISTER_RAND_GEN_DEBUG
-#define PB_DS_DBG_ASSERT(X) assert(X)
-#define PB_DS_DBG_VERIFY(X) assert(X)
-#define PB_DS_DBG_ONLY(X) X
-#else // #ifdef PB_DS_TWISTER_RAND_GEN_DEBUG
-#define PB_DS_DBG_ASSERT(X)
-#define PB_DS_DBG_VERIFY(X) {if((X)==0);}
-#define PB_DS_DBG_ONLY(X) ;
-#endif // #ifdef PB_DS_TWISTER_RAND_GEN_DEBUG
-
twister_rand_gen::
twister_rand_gen(unsigned int seed)
: m_base_generator(seed)
@@ -76,14 +67,14 @@ namespace pb_ds
twister_rand_gen::
get_unsigned_long(unsigned long min, unsigned long max)
{
- PB_DS_DBG_ASSERT(max >= min);
+ _GLIBCXX_DEBUG_ASSERT(max >= min);
const double prob = get_prob();
const unsigned long rand_word =
(unsigned long)((max - min + 1) * prob) + min;
- PB_DS_DBG_ASSERT(rand_word <= max);
+ _GLIBCXX_DEBUG_ASSERT(rand_word <= max);
return rand_word;
}
@@ -101,13 +92,9 @@ namespace pb_ds
const double ret = eng_res / eng_range;
- PB_DS_DBG_ASSERT(ret >=0 && ret <= 1);
+ _GLIBCXX_DEBUG_ASSERT(ret >=0 && ret <= 1);
return ret;
}
-
-#undef PB_DS_DBG_ASSERT
-#undef PB_DS_DBG_VERIFY
-#undef PB_DS_DBG_ONLY
} // namespace test
} // namespace pb_ds
OpenPOWER on IntegriCloud