Revert "Update aosp/master libcxx rebase to r263688"
The world is burning. This reverts commitc004fd909c, reversing changes made to1418e4163d.
This commit is contained in:
@@ -10,17 +10,15 @@
|
||||
// <string>
|
||||
|
||||
// const charT* data() const;
|
||||
// charT* data(); // C++17
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
void
|
||||
test_const(const S& s)
|
||||
test(const S& s)
|
||||
{
|
||||
typedef typename S::traits_type T;
|
||||
const typename S::value_type* str = s.data();
|
||||
@@ -33,46 +31,22 @@ test_const(const S& s)
|
||||
assert(T::eq(str[0], typename S::value_type()));
|
||||
}
|
||||
|
||||
template <class S>
|
||||
void
|
||||
test_nonconst(S& s)
|
||||
{
|
||||
typedef typename S::traits_type T;
|
||||
typename S::value_type* str = s.data();
|
||||
if (s.size() > 0)
|
||||
{
|
||||
assert(T::compare(str, &s[0], s.size()) == 0);
|
||||
assert(T::eq(str[s.size()], typename S::value_type()));
|
||||
}
|
||||
else
|
||||
assert(T::eq(str[0], typename S::value_type()));
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef std::string S;
|
||||
test_const(S(""));
|
||||
test_const(S("abcde"));
|
||||
test_const(S("abcdefghij"));
|
||||
test_const(S("abcdefghijklmnopqrst"));
|
||||
test(S(""));
|
||||
test(S("abcde"));
|
||||
test(S("abcdefghij"));
|
||||
test(S("abcdefghijklmnopqrst"));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test_const(S(""));
|
||||
test_const(S("abcde"));
|
||||
test_const(S("abcdefghij"));
|
||||
test_const(S("abcdefghijklmnopqrst"));
|
||||
}
|
||||
#endif
|
||||
#if TEST_STD_VER > 14
|
||||
{
|
||||
typedef std::string S;
|
||||
S s1(""); test_nonconst(s1);
|
||||
S s2("abcde"); test_nonconst(s2);
|
||||
S s3("abcdefghij"); test_nonconst(s3);
|
||||
S s4("abcdefghijklmnopqrst"); test_nonconst(s4);
|
||||
test(S(""));
|
||||
test(S("abcde"));
|
||||
test(S("abcdefghij"));
|
||||
test(S("abcdefghijklmnopqrst"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// int compare(size_type pos, size_type n1, const charT *s) const;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// int compare(size_type pos, size_type n1, const charT *s, size_type n2) const;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// int compare(size_type pos1, size_type n1, const basic_string& str) const;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// int compare(size_type pos1, size_type n1, const basic_string& str,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string substr(size_type pos = 0, size_type n = npos) const;
|
||||
@@ -17,7 +16,6 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -27,7 +25,7 @@ test(const S& s, typename S::size_type pos, typename S::size_type n)
|
||||
try
|
||||
{
|
||||
S str = s.substr(pos, n);
|
||||
LIBCPP_ASSERT(str.__invariants());
|
||||
assert(str.__invariants());
|
||||
assert(pos <= s.size());
|
||||
typename S::size_type rlen = std::min(n, s.size() - pos);
|
||||
assert(str.size() == rlen);
|
||||
@@ -102,7 +100,7 @@ int main()
|
||||
test(S("lsaijeqhtrbgcdmpfkno"), 20, 0);
|
||||
test(S("dplqartnfgejichmoskb"), 21, 0);
|
||||
}
|
||||
#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);
|
||||
|
||||
Reference in New Issue
Block a user