From 6f9ba7a2899e6662a66c2eca4abd5dc99a1c0577 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 27 Jun 2003 11:11:21 +0000 Subject: [PATCH] Added new concept check, removed assertion in degug allocator that was being triggered by std lib code ! [SVN r18873] --- test/Jamfile | 4 ++++ test/pathology/concept_check.cpp | 38 ++++++++++++++++++++++++++++++++ test/regress/regress.h | 3 +-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 test/pathology/concept_check.cpp diff --git a/test/Jamfile b/test/Jamfile index fd10197b..de2945ed 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -75,7 +75,11 @@ test-suite regex pathology/recursion_test.cpp ../../test/build/boost_test_exec_monitor ] + + [ compile pathology/concept_check.cpp + ] ; + diff --git a/test/pathology/concept_check.cpp b/test/pathology/concept_check.cpp new file mode 100644 index 00000000..65edb04f --- /dev/null +++ b/test/pathology/concept_check.cpp @@ -0,0 +1,38 @@ + +#include +#include +#include + + +int main() +{ + typedef boost::bidirectional_iterator_archetype iterator_type; + boost::regex r; + iterator_type a, b; + boost::detail::dummy_constructor dummy; + boost::output_iterator_archetype out(dummy); + std::string s; + boost::match_results what; + + boost::regex_match(a, b, r); + boost::regex_match(a, b, what, r); + boost::regex_search(a, b, r); + boost::regex_search(a, b, what, r); + out = boost::regex_replace(out, a, b, r, s, boost::match_default); + s = boost::regex_replace(s, r, s, boost::match_default); + + out = what.format(out, s, boost::format_default); + s = what.format(s, boost::format_default); + + boost::function_requires< + boost::ForwardIteratorConcept< + boost::regex_iterator + > + >(); + boost::function_requires< + boost::ForwardIteratorConcept< + boost::regex_token_iterator + > + >(); + +} diff --git a/test/regress/regress.h b/test/regress/regress.h index 94be2e89..a52b90ae 100644 --- a/test/regress/regress.h +++ b/test/regress/regress.h @@ -157,8 +157,7 @@ public: void deallocate(pointer p, size_type n) { - assert( (p == 0) == (n == 0) ); - if (p != 0) + if ((p != 0) && (n != 0)) base_type::deallocate((void*)p, n * sizeof(value_type)); }