Fix wchar tests by not assuming that tm is complete and by using the

proper va_list time on non-darwin platforms.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135247 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Hunt 2011-07-15 05:44:47 +00:00
parent f3907e6cc0
commit a78264f872
2 changed files with 12 additions and 4 deletions

View File

@ -32,10 +32,14 @@ int main()
{ {
mbstate_t mb = {0}; mbstate_t mb = {0};
size_t s = 0; size_t s = 0;
tm tm = {0}; tm *tm = 0;
wint_t w = 0; wint_t w = 0;
::FILE* fp = 0; ::FILE* fp = 0;
#ifdef __APPLE__
__darwin_va_list va; __darwin_va_list va;
#else
__builtin_va_list va;
#endif
char* ns = 0; char* ns = 0;
wchar_t* ws = 0; wchar_t* ws = 0;
static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), ""); static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), "");
@ -88,7 +92,7 @@ int main()
static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wmemmove(ws, L"", s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wmemmove(ws, L"", s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wmemset(ws, L' ', s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(wmemset(ws, L' ', s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(wcsftime(ws, s, L"", &tm)), size_t>::value), ""); static_assert((std::is_same<decltype(wcsftime(ws, s, L"", tm)), size_t>::value), "");
static_assert((std::is_same<decltype(btowc(0)), wint_t>::value), ""); static_assert((std::is_same<decltype(btowc(0)), wint_t>::value), "");
static_assert((std::is_same<decltype(wctob(w)), int>::value), ""); static_assert((std::is_same<decltype(wctob(w)), int>::value), "");
static_assert((std::is_same<decltype(mbsinit(&mb)), int>::value), ""); static_assert((std::is_same<decltype(mbsinit(&mb)), int>::value), "");

View File

@ -32,10 +32,14 @@ int main()
{ {
std::mbstate_t mb = {0}; std::mbstate_t mb = {0};
std::size_t s = 0; std::size_t s = 0;
std::tm tm = {0}; std::tm *tm = 0;
std::wint_t w = 0; std::wint_t w = 0;
::FILE* fp = 0; ::FILE* fp = 0;
#ifdef __APPLE__
__darwin_va_list va; __darwin_va_list va;
#else
__builtin_va_list va;
#endif
char* ns = 0; char* ns = 0;
wchar_t* ws = 0; wchar_t* ws = 0;
static_assert((std::is_same<decltype(std::fwprintf(fp, L"")), int>::value), ""); static_assert((std::is_same<decltype(std::fwprintf(fp, L"")), int>::value), "");
@ -93,7 +97,7 @@ int main()
static_assert((std::is_same<decltype(std::wmemcpy(ws, L"", s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(std::wmemcpy(ws, L"", s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(std::wmemmove(ws, L"", s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(std::wmemmove(ws, L"", s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(std::wmemset(ws, L' ', s)), wchar_t*>::value), ""); static_assert((std::is_same<decltype(std::wmemset(ws, L' ', s)), wchar_t*>::value), "");
static_assert((std::is_same<decltype(std::wcsftime(ws, s, L"", &tm)), std::size_t>::value), ""); static_assert((std::is_same<decltype(std::wcsftime(ws, s, L"", tm)), std::size_t>::value), "");
static_assert((std::is_same<decltype(std::btowc(0)), wint_t>::value), ""); static_assert((std::is_same<decltype(std::btowc(0)), wint_t>::value), "");
static_assert((std::is_same<decltype(std::wctob(w)), int>::value), ""); static_assert((std::is_same<decltype(std::wctob(w)), int>::value), "");
static_assert((std::is_same<decltype(std::mbsinit(&mb)), int>::value), ""); static_assert((std::is_same<decltype(std::mbsinit(&mb)), int>::value), "");