Debug mode for string. This commit also marks the first time libc++ debug-mode has found a bug (found one in regex). Had to play with extern templates a bit to get this to work since string is heavily used within libc++.dylib.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,10 +27,10 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expecte
|
||||
typename S::size_type old_size = s.size();
|
||||
typename S::const_iterator first = s.begin() + pos1;
|
||||
typename S::const_iterator last = s.begin() + pos1 + n1;
|
||||
typename S::size_type xlen = last - first;
|
||||
s.replace(first, last, str);
|
||||
assert(s.__invariants());
|
||||
assert(s == expected);
|
||||
typename S::size_type xlen = last - first;
|
||||
typename S::size_type rlen = str.size();
|
||||
assert(s.size() == old_size - xlen + rlen);
|
||||
}
|
||||
|
Reference in New Issue
Block a user