Revert "Revert "Update aosp/master libcxx rebase to r263688""

This reverts commit 1d4a1edbc7.

Change-Id: I2909937fe582f2c5552bc86e7f4d2d5cff0de0aa
This commit is contained in:
Dan Austin
2016-06-08 22:25:43 +00:00
parent 1d4a1edbc7
commit ee226c05af
1396 changed files with 38992 additions and 11535 deletions

View File

@@ -24,7 +24,7 @@ int main()
s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'});
assert(s == "123abc456");
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
S s("123def456");

View File

@@ -18,6 +18,7 @@
#include <cassert>
#include "min_allocator.h"
#include "test_iterators.h"
template <class S, class It>
void
@@ -28,12 +29,30 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, It f, It l, S ex
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, f, l);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = std::distance(f, l);
assert(s.size() == old_size - xlen + rlen);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
template <class S, class It>
void
test_exceptions(S s, typename S::size_type pos1, typename S::size_type n1, It f, It l)
{
typename S::const_iterator first = s.begin() + pos1;
typename S::const_iterator last = s.begin() + pos1 + n1;
S aCopy = s;
try {
s.replace(first, last, f, l);
assert(false);
}
catch (...) {}
LIBCPP_ASSERT(s.__invariants());
assert(s == aCopy);
}
#endif
const char* str = "12345678901234567890";
template <class S>
@@ -959,7 +978,7 @@ int main()
test7<S>();
test8<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();
@@ -973,4 +992,19 @@ int main()
test8<S>();
}
#endif
#ifndef TEST_HAS_NO_EXCEPTIONS
{ // test iterator operations that throw
typedef std::string S;
typedef ThrowingIterator<char> TIter;
typedef input_iterator<TIter> IIter;
const char* s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, IIter(TIter(s, s+10, 4, TIter::TAIncrement)), IIter());
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, IIter(TIter(s, s+10, 5, TIter::TADereference)), IIter());
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, IIter(TIter(s, s+10, 6, TIter::TAComparison)), IIter());
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, TIter(s, s+10, 4, TIter::TAIncrement), TIter());
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, TIter(s, s+10, 5, TIter::TADereference), TIter());
test_exceptions(S("abcdefghijklmnopqrst"), 10, 5, TIter(s, s+10, 6, TIter::TAComparison), TIter());
}
#endif
}

View File

@@ -29,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, const typename S
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, str);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = S::traits_type::length(str);
assert(s.size() == old_size - xlen + rlen);
@@ -274,7 +274,7 @@ int main()
test1<S>();
test2<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -12,12 +12,11 @@
// basic_string<charT,traits,Allocator>&
// replace(const_iterator i1, const_iterator i2, const charT* s, size_type n);
#include <stdio.h>
#include <string>
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -30,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, const typename S
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, str, n2);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = n2;
assert(s.size() == old_size - xlen + rlen);
@@ -959,7 +958,7 @@ int main()
test7<S>();
test8<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -12,12 +12,11 @@
// basic_string<charT,traits,Allocator>&
// replace(const_iterator i1, const_iterator i2, size_type n, charT c);
#include <stdio.h>
#include <string>
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -30,7 +29,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, typename S::size
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, n2, c);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = n2;
assert(s.size() == old_size - xlen + rlen);
@@ -275,7 +274,7 @@ int main()
test1<S>();
test2<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -12,12 +12,11 @@
// basic_string<charT,traits,Allocator>&
// replace(const_iterator i1, const_iterator i2, const basic_string& str);
#include <stdio.h>
#include <string>
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -29,7 +28,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expecte
typename S::const_iterator last = s.begin() + pos1 + n1;
typename S::size_type xlen = last - first;
s.replace(first, last, str);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(s == expected);
typename S::size_type rlen = str.size();
assert(s.size() == old_size - xlen + rlen);
@@ -274,7 +273,7 @@ int main()
test1<S>();
test2<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -7,18 +7,18 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
// replace(size_type pos, size_type n1, const charT* s);
#include <stdio.h>
#include <string>
#include <stdexcept>
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -31,7 +31,7 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
try
{
s.replace(pos, n1, str);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
@@ -364,7 +364,7 @@ int main()
test1<S>();
test2<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -7,18 +7,18 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
// replace(size_type pos, size_type n1, const charT* s, size_type n2);
#include <stdio.h>
#include <string>
#include <stdexcept>
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -32,7 +32,7 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
try
{
s.replace(pos, n1, str, n2);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
@@ -1307,7 +1307,7 @@ int main()
test10<S>();
test11<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -17,6 +18,7 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -30,7 +32,7 @@ test(S s, typename S::size_type pos, typename S::size_type n1,
try
{
s.replace(pos, n1, n2, c);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(pos <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos);
@@ -363,7 +365,7 @@ int main()
test1<S>();
test2<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -17,6 +18,7 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -28,7 +30,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S expecte
try
{
s.replace(pos1, n1, str);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(pos1 <= old_size);
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
@@ -361,7 +363,7 @@ int main()
test1<S>();
test2<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string<charT,traits,Allocator>&
@@ -19,6 +20,7 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
template <class S>
@@ -32,7 +34,7 @@ test(S s, typename S::size_type pos1, typename S::size_type n1,
try
{
s.replace(pos1, n1, str, pos2, n2);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
@@ -57,7 +59,7 @@ test_npos(S s, typename S::size_type pos1, typename S::size_type n1,
try
{
s.replace(pos1, n1, str, pos2);
assert(s.__invariants());
LIBCPP_ASSERT(s.__invariants());
assert(pos1 <= old_size && pos2 <= str.size());
assert(s == expected);
typename S::size_type xlen = std::min(n1, old_size - pos1);
@@ -5902,7 +5904,7 @@ int main()
test54<S>();
test55<S>();
}
#if __cplusplus >= 201103L
#if TEST_STD_VER >= 11
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test0<S>();