c66dc02384
Add testsuite/testsuite_string.h header to help testing __gnu_debug::basic_string like std::basic_string depending on _GLIBCXX_DEBUG. Add using of base type methods in __gnu_debug::basic_string to make use of the method overloads when there is no debug version. Fix _GLIBCXX_DEBUG_PEDANTIC assertions in <debug/string>. This header has to be used directly like __gnu_debug::string, it is not included by _GLIBCXX_DEBUG. It means that _GLIBCXX_DEBUG_PEDANTIC is not considered to define __glibcxx_check_string and __glibcxx_check_string_len which are then empty macros. Now those macros are defined directly in <debug/string> and properly consider _GLIBCXX_DEBUG_PEDANTIC. libstdc++-v3/ChangeLog: * include/debug/debug.h [_GLIBCXX_DEBUG](__glibcxx_requires_string): Define using _GLIBCXX_DEBUG_PEDASSERT. [_GLIBCXX_DEBUG](__glibcxx_requires_string_len): Likewise. * include/debug/macros.h (__glibcxx_check_string, __glibcxx_check_string_len): Move... * include/debug/string (__glibcxx_check_string, __glibcxx_check_string_len): ...here. And define depending on _GLIBCXX_DEBUG_PEDANTIC no matter if _GLIBCXX_DEBUG is defined. Add using of std::string find, rfind, find_first_of, find_last_of, find_first_not_of and find_last_not_of. Remove debug implementations having no debug assertion. * testsuite/util/testsuite_string.h: New file. Provides __gnu_test::string and __gnu_test::wtring which definition depends on _GLIBCXX_DEBUG. * testsuite/21_strings/basic_string/debug/find1_neg.cc: New test case. * testsuite/21_strings/basic_string/debug/find2_neg.cc: New test case. * testsuite/21_strings/basic_string/operations/find/char/1.cc: Include <testsuite_string.h> and use __gnu_test::string. * testsuite/21_strings/basic_string/operations/find/char/2.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/char/3.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/char/4.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/char/5.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/char/6.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/wchar_t/1.cc: Include <testsuite_string.h> and use __gnu_test::wstring. * testsuite/21_strings/basic_string/operations/find/wchar_t/2.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/wchar_t/3.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/wchar_t/4.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc: Likewise. * testsuite/21_strings/basic_string/operations/find/wchar_t/6.cc: Likewise. |
||
---|---|---|
.. | ||
array | ||
assertions.h | ||
bitset | ||
debug.h | ||
deque | ||
formatter.h | ||
forward_list | ||
functions.h | ||
helper_functions.h | ||
list | ||
macros.h | ||
map | ||
map.h | ||
multimap.h | ||
multiset.h | ||
safe_base.h | ||
safe_container.h | ||
safe_iterator.h | ||
safe_iterator.tcc | ||
safe_local_iterator.h | ||
safe_local_iterator.tcc | ||
safe_sequence.h | ||
safe_sequence.tcc | ||
safe_unordered_base.h | ||
safe_unordered_container.h | ||
safe_unordered_container.tcc | ||
set | ||
set.h | ||
stl_iterator.h | ||
string | ||
unordered_map | ||
unordered_set | ||
vector |