Revert "Update aosp/master libcxx rebase to r263688"
The world is burning. This reverts commitc004fd909c, reversing changes made to1418e4163d.
This commit is contained in:
@@ -11,11 +11,14 @@
|
||||
|
||||
// iterator insert(const_iterator p, charT c);
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -25,7 +28,7 @@ test(S& s, typename S::const_iterator p, typename S::value_type c, S expected)
|
||||
bool sufficient_cap = s.size() < s.capacity();
|
||||
typename S::difference_type pos = p - s.begin();
|
||||
typename S::iterator i = s.insert(p, c);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(s == expected);
|
||||
assert(i - s.begin() == pos);
|
||||
assert(*i == c);
|
||||
@@ -53,7 +56,7 @@ int main()
|
||||
test(s, s.begin()+5, 'B', S("a567AB1432dcb"));
|
||||
test(s, s.begin()+6, 'C', S("a567ABC1432dcb"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S s;
|
||||
@@ -73,4 +76,13 @@ int main()
|
||||
test(s, s.begin()+6, 'C', S("a567ABC1432dcb"));
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
{
|
||||
typedef std::string S;
|
||||
S s;
|
||||
S s2;
|
||||
s.insert(s2.begin(), '1');
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ int main()
|
||||
assert(i - s.begin() == 3);
|
||||
assert(s == "123abc456");
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S s("123456");
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_iterators.h"
|
||||
#include "../../input_iterator.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S, class It>
|
||||
@@ -28,28 +28,11 @@ test(S s, typename S::difference_type pos, It first, It last, S expected)
|
||||
{
|
||||
typename S::const_iterator p = s.cbegin() + pos;
|
||||
typename S::iterator i = s.insert(p, first, last);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(i - s.begin() == pos);
|
||||
assert(s == expected);
|
||||
}
|
||||
|
||||
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||
template <class S, class It>
|
||||
void
|
||||
test_exceptions(S s, typename S::difference_type pos, It first, It last)
|
||||
{
|
||||
typename S::const_iterator p = s.cbegin() + pos;
|
||||
S aCopy = s;
|
||||
try {
|
||||
s.insert(p, first, last);
|
||||
assert(false);
|
||||
}
|
||||
catch (...) {}
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s == aCopy);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -97,7 +80,7 @@ int main()
|
||||
test(S("12345678901234567890"), 20, input_iterator<const char*>(s), input_iterator<const char*>(s+52),
|
||||
S("12345678901234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
const char* s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
@@ -144,21 +127,6 @@ int main()
|
||||
S("12345678901234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"));
|
||||
}
|
||||
#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(), 0, IIter(TIter(s, s+10, 4, TIter::TAIncrement)), IIter());
|
||||
test_exceptions(S(), 0, IIter(TIter(s, s+10, 5, TIter::TADereference)), IIter());
|
||||
test_exceptions(S(), 0, IIter(TIter(s, s+10, 6, TIter::TAComparison)), IIter());
|
||||
|
||||
test_exceptions(S(), 0, TIter(s, s+10, 4, TIter::TAIncrement), TIter());
|
||||
test_exceptions(S(), 0, TIter(s, s+10, 5, TIter::TADereference), TIter());
|
||||
test_exceptions(S(), 0, TIter(s, s+10, 6, TIter::TAComparison), TIter());
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
{
|
||||
std::string v;
|
||||
|
||||
@@ -11,10 +11,13 @@
|
||||
|
||||
// iterator insert(const_iterator p, size_type n, charT c);
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -24,7 +27,7 @@ test(S s, typename S::difference_type pos, typename S::size_type n,
|
||||
{
|
||||
typename S::const_iterator p = s.cbegin() + pos;
|
||||
typename S::iterator i = s.insert(p, n, c);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(i - s.begin() == pos);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -98,7 +101,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 20, 10, '1', S("abcdefghijklmnopqrst1111111111"));
|
||||
test(S("abcdefghijklmnopqrst"), 20, 20, '1', S("abcdefghijklmnopqrst11111111111111111111"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, 0, '1', S(""));
|
||||
@@ -167,4 +170,12 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 20, 20, '1', S("abcdefghijklmnopqrst11111111111111111111"));
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
{
|
||||
std::string s;
|
||||
std::string s2;
|
||||
s.insert(s2.begin(), 1, 'a');
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
@@ -17,7 +16,6 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -29,7 +27,7 @@ test(S s, typename S::size_type pos, const typename S::value_type* str, S expect
|
||||
try
|
||||
{
|
||||
s.insert(pos, str);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(pos <= old_size);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -125,7 +123,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 21, "1234567890", S("can't happen"));
|
||||
test(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", S("can't happen"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, "", S(""));
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
@@ -17,7 +16,6 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -30,7 +28,7 @@ test(S s, typename S::size_type pos, const typename S::value_type* str,
|
||||
try
|
||||
{
|
||||
s.insert(pos, str, n);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(pos <= old_size);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -366,7 +364,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", 19, S("can't happen"));
|
||||
test(S("abcdefghijklmnopqrst"), 21, "12345678901234567890", 20, S("can't happen"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, "", 0, S(""));
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
@@ -17,7 +16,6 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -30,7 +28,7 @@ test(S s, typename S::size_type pos, typename S::size_type n,
|
||||
try
|
||||
{
|
||||
s.insert(pos, n, str);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(pos <= old_size);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -126,7 +124,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 21, 10, '1', S("can't happen"));
|
||||
test(S("abcdefghijklmnopqrst"), 21, 20, '1', S("can't happen"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, 0, '1', S(""));
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
@@ -17,7 +16,6 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -29,7 +27,7 @@ test(S s, typename S::size_type pos, S str, S expected)
|
||||
try
|
||||
{
|
||||
s.insert(pos, str);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(pos <= old_size);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -125,7 +123,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 21, S("1234567890"), S("can't happen"));
|
||||
test(S("abcdefghijklmnopqrst"), 21, S("12345678901234567890"), S("can't happen"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, S(""), S(""));
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
@@ -19,7 +18,6 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -32,7 +30,7 @@ test(S s, typename S::size_type pos1, S str, typename S::size_type pos2,
|
||||
try
|
||||
{
|
||||
s.insert(pos1, str, pos2, n);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(pos1 <= old_size && pos2 <= str.size());
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -52,7 +50,7 @@ test_npos(S s, typename S::size_type pos1, S str, typename S::size_type pos2, S
|
||||
try
|
||||
{
|
||||
s.insert(pos1, str, pos2);
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s.__invariants());
|
||||
assert(pos1 <= old_size && pos2 <= str.size());
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -1747,7 +1745,7 @@ int main()
|
||||
test29<S>();
|
||||
test30<S>();
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test0<S>();
|
||||
|
||||
Reference in New Issue
Block a user