forked from OSchip/llvm-project
A bunch of the char.traits tests were using unicode literals. #ifdef those bits out on c++03, since it doesn't support u"" and U "" style strings.
llvm-svn: 210560
This commit is contained in:
parent
19b1d73e88
commit
98763eb520
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
char16_t c = u'\0';
|
||||
std::char_traits<char16_t>::assign(c, u'a');
|
||||
assert(c == u'a');
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char16_t>::compare(u"", u"", 0) == 0);
|
||||
|
||||
assert(std::char_traits<char16_t>::compare(u"1", u"1", 1) == 0);
|
||||
|
@ -38,5 +39,6 @@ int main()
|
|||
assert(std::char_traits<char16_t>::compare(u"223", u"123", 3) > 0);
|
||||
assert(std::char_traits<char16_t>::compare(u"133", u"123", 3) > 0);
|
||||
assert(std::char_traits<char16_t>::compare(u"124", u"123", 3) > 0);
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
char16_t c = u'\0';
|
||||
assert(std::char_traits<char16_t>::eq(u'a', u'a'));
|
||||
assert(!std::char_traits<char16_t>::eq(u'a', u'A'));
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert( std::char_traits<char16_t>::eq_int_type(u'a', u'a'));
|
||||
assert(!std::char_traits<char16_t>::eq_int_type(u'a', u'A'));
|
||||
assert(!std::char_traits<char16_t>::eq_int_type(std::char_traits<char16_t>::eof(), u'A'));
|
||||
#endif
|
||||
assert( std::char_traits<char16_t>::eq_int_type(std::char_traits<char16_t>::eof(),
|
||||
std::char_traits<char16_t>::eof()));
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
|
|
|
@ -19,10 +19,12 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char16_t>::length(u"") == 0);
|
||||
assert(std::char_traits<char16_t>::length(u"a") == 1);
|
||||
assert(std::char_traits<char16_t>::length(u"aa") == 2);
|
||||
assert(std::char_traits<char16_t>::length(u"aaa") == 3);
|
||||
assert(std::char_traits<char16_t>::length(u"aaaa") == 4);
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
char16_t c = u'\0';
|
||||
assert(!std::char_traits<char16_t>::lt(u'a', u'a'));
|
||||
assert( std::char_traits<char16_t>::lt(u'A', u'a'));
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char16_t>::not_eof(u'a') == u'a');
|
||||
assert(std::char_traits<char16_t>::not_eof(u'A') == u'A');
|
||||
#endif
|
||||
assert(std::char_traits<char16_t>::not_eof(0) == 0);
|
||||
assert(std::char_traits<char16_t>::not_eof(std::char_traits<char16_t>::eof()) !=
|
||||
std::char_traits<char16_t>::eof());
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char16_t>::to_char_type(u'a') == u'a');
|
||||
assert(std::char_traits<char16_t>::to_char_type(u'A') == u'A');
|
||||
#endif
|
||||
assert(std::char_traits<char16_t>::to_char_type(0) == 0);
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char16_t>::to_int_type(u'a') == u'a');
|
||||
assert(std::char_traits<char16_t>::to_int_type(u'A') == u'A');
|
||||
#endif
|
||||
assert(std::char_traits<char16_t>::to_int_type(0) == 0);
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
char32_t c = U'\0';
|
||||
std::char_traits<char32_t>::assign(c, U'a');
|
||||
assert(c == U'a');
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char32_t>::compare(U"", U"", 0) == 0);
|
||||
|
||||
assert(std::char_traits<char32_t>::compare(U"1", U"1", 1) == 0);
|
||||
|
@ -38,5 +39,6 @@ int main()
|
|||
assert(std::char_traits<char32_t>::compare(U"223", U"123", 3) > 0);
|
||||
assert(std::char_traits<char32_t>::compare(U"133", U"123", 3) > 0);
|
||||
assert(std::char_traits<char32_t>::compare(U"124", U"123", 3) > 0);
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
char32_t c = U'\0';
|
||||
assert(std::char_traits<char32_t>::eq(U'a', U'a'));
|
||||
assert(!std::char_traits<char32_t>::eq(U'a', U'A'));
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert( std::char_traits<char32_t>::eq_int_type(U'a', U'a'));
|
||||
assert(!std::char_traits<char32_t>::eq_int_type(U'a', U'A'));
|
||||
assert(!std::char_traits<char32_t>::eq_int_type(std::char_traits<char32_t>::eof(), U'A'));
|
||||
#endif
|
||||
assert( std::char_traits<char32_t>::eq_int_type(std::char_traits<char32_t>::eof(),
|
||||
std::char_traits<char32_t>::eof()));
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
|
|
|
@ -19,10 +19,12 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char32_t>::length(U"") == 0);
|
||||
assert(std::char_traits<char32_t>::length(U"a") == 1);
|
||||
assert(std::char_traits<char32_t>::length(U"aa") == 2);
|
||||
assert(std::char_traits<char32_t>::length(U"aaa") == 3);
|
||||
assert(std::char_traits<char32_t>::length(U"aaaa") == 4);
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
char32_t c = U'\0';
|
||||
assert(!std::char_traits<char32_t>::lt(U'a', U'a'));
|
||||
assert( std::char_traits<char32_t>::lt(U'A', U'a'));
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char32_t>::not_eof(U'a') == U'a');
|
||||
assert(std::char_traits<char32_t>::not_eof(U'A') == U'A');
|
||||
#endif
|
||||
assert(std::char_traits<char32_t>::not_eof(0) == 0);
|
||||
assert(std::char_traits<char32_t>::not_eof(std::char_traits<char32_t>::eof()) !=
|
||||
std::char_traits<char32_t>::eof());
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char32_t>::to_char_type(U'a') == U'a');
|
||||
assert(std::char_traits<char32_t>::to_char_type(U'A') == U'A');
|
||||
#endif
|
||||
assert(std::char_traits<char32_t>::to_char_type(0) == 0);
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#if __cplusplus >= 201103L
|
||||
assert(std::char_traits<char32_t>::to_int_type(U'a') == U'a');
|
||||
assert(std::char_traits<char32_t>::to_int_type(U'A') == U'A');
|
||||
#endif
|
||||
assert(std::char_traits<char32_t>::to_int_type(0) == 0);
|
||||
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue