diff options
| author | Eric Fiselier <eric@efcs.ca> | 2014-08-12 00:48:56 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2014-08-12 00:48:56 +0000 |
| commit | 90e0867742ae00e66a337234ca2ec087cdb6958f (patch) | |
| tree | 1972b68b341d7d6bb5cbc3fca224bae6292aec20 /libcxx | |
| parent | 3d1a94c6a63692541896a42388a4c08efbd59959 (diff) | |
| download | bcm5719-llvm-90e0867742ae00e66a337234ca2ec087cdb6958f.tar.gz bcm5719-llvm-90e0867742ae00e66a337234ca2ec087cdb6958f.zip | |
Change two tests to be less dependant on locales.
This patch removes the use of the "%c" specifier for getting/setting times.
The semantics of this specifier differ between linux and Mac. I don't believe
the use of this specifier was important to the test.
The following tests now pass on linux.
test/input.output/iostream.format/ext.manip/get_time.pass.cpp
test/input.output/iostream.format/ext.manip/put_time.pass.cpp
llvm-svn: 215417
Diffstat (limited to 'libcxx')
| -rw-r--r-- | libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp | 4 | ||||
| -rw-r--r-- | libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp b/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp index 686655245d5..17ff642dc46 100644 --- a/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp +++ b/libcxx/test/input.output/iostream.format/ext.manip/get_time.pass.cpp @@ -43,7 +43,7 @@ int main() std::istream is(&sb); is.imbue(std::locale(LOCALE_en_US_UTF_8)); std::tm t = {0}; - is >> std::get_time(&t, "%c"); + is >> std::get_time(&t, "%a %b %d %H:%M:%S %Y"); assert(t.tm_sec == 59); assert(t.tm_min == 55); assert(t.tm_hour == 23); @@ -59,7 +59,7 @@ int main() std::wistream is(&sb); is.imbue(std::locale(LOCALE_en_US_UTF_8)); std::tm t = {0}; - is >> std::get_time(&t, L"%c"); + is >> std::get_time(&t, L"%a %b %d %H:%M:%S %Y"); assert(t.tm_sec == 59); assert(t.tm_min == 55); assert(t.tm_hour == 23); diff --git a/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp b/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp index d64ca07f830..52a98a1b568 100644 --- a/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp +++ b/libcxx/test/input.output/iostream.format/ext.manip/put_time.pass.cpp @@ -62,7 +62,8 @@ int main() t.tm_mon = 11; t.tm_year = 161; t.tm_wday = 6; - os << std::put_time(&t, "%c"); + t.tm_isdst = 0; + os << std::put_time(&t, "%a %b %d %H:%M:%S %Y"); assert(sb.str() == "Sat Dec 31 23:55:59 2061"); } { @@ -77,7 +78,7 @@ int main() t.tm_mon = 11; t.tm_year = 161; t.tm_wday = 6; - os << std::put_time(&t, L"%c"); + os << std::put_time(&t, L"%a %b %d %H:%M:%S %Y"); assert(sb.str() == L"Sat Dec 31 23:55:59 2061"); } } |

