Windows porting work by Ruben Van Boxem

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@141003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2011-10-03 15:23:59 +00:00
parent 8452d21f41
commit c0d0cbad9e
90 changed files with 558 additions and 343 deletions

View File

@@ -14,6 +14,8 @@
#include <iomanip>
#include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT>
struct testbuf
: public std::basic_streambuf<CharT>
@@ -39,7 +41,7 @@ int main()
{
testbuf<char> sb(" -$1,234,567.89");
std::istream is(&sb);
is.imbue(std::locale("en_US.UTF-8"));
is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0;
is >> std::get_money(x, false);
assert(x == -123456789);
@@ -47,7 +49,7 @@ int main()
{
testbuf<char> sb(" -USD 1,234,567.89");
std::istream is(&sb);
is.imbue(std::locale("en_US.UTF-8"));
is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0;
is >> std::get_money(x, true);
assert(x == -123456789);
@@ -55,7 +57,7 @@ int main()
{
testbuf<wchar_t> sb(L" -$1,234,567.89");
std::wistream is(&sb);
is.imbue(std::locale("en_US.UTF-8"));
is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0;
is >> std::get_money(x, false);
assert(x == -123456789);
@@ -63,7 +65,7 @@ int main()
{
testbuf<wchar_t> sb(L" -USD 1,234,567.89");
std::wistream is(&sb);
is.imbue(std::locale("en_US.UTF-8"));
is.imbue(std::locale(LOCALE_en_US_UTF_8));
long double x = 0;
is >> std::get_money(x, true);
assert(x == -123456789);

View File

@@ -14,6 +14,8 @@
#include <iomanip>
#include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT>
struct testbuf
: public std::basic_streambuf<CharT>
@@ -39,7 +41,7 @@ int main()
{
testbuf<char> sb(" Sat Dec 31 23:55:59 2061");
std::istream is(&sb);
is.imbue(std::locale("en_US.UTF-8"));
is.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0};
is >> std::get_time(&t, "%c");
assert(t.tm_sec == 59);
@@ -55,7 +57,7 @@ int main()
{
testbuf<wchar_t> sb(L" Sat Dec 31 23:55:59 2061");
std::wistream is(&sb);
is.imbue(std::locale("en_US.UTF-8"));
is.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0};
is >> std::get_time(&t, L"%c");
assert(t.tm_sec == 59);

View File

@@ -14,6 +14,8 @@
#include <iomanip>
#include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT>
class testbuf
: public std::basic_streambuf<CharT>
@@ -51,7 +53,7 @@ int main()
{
testbuf<char> sb;
std::ostream os(&sb);
os.imbue(std::locale("en_US.UTF-8"));
os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os);
long double x = -123456789;
os << std::put_money(x, false);
@@ -60,7 +62,7 @@ int main()
{
testbuf<char> sb;
std::ostream os(&sb);
os.imbue(std::locale("en_US.UTF-8"));
os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os);
long double x = -123456789;
os << std::put_money(x, true);
@@ -69,7 +71,7 @@ int main()
{
testbuf<wchar_t> sb;
std::wostream os(&sb);
os.imbue(std::locale("en_US.UTF-8"));
os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os);
long double x = -123456789;
os << std::put_money(x, false);
@@ -78,7 +80,7 @@ int main()
{
testbuf<wchar_t> sb;
std::wostream os(&sb);
os.imbue(std::locale("en_US.UTF-8"));
os.imbue(std::locale(LOCALE_en_US_UTF_8));
showbase(os);
long double x = -123456789;
os << std::put_money(x, true);

View File

@@ -14,6 +14,8 @@
#include <iomanip>
#include <cassert>
#include "../../../platform_support.h" // locale name macros
template <class CharT>
class testbuf
: public std::basic_streambuf<CharT>
@@ -51,7 +53,7 @@ int main()
{
testbuf<char> sb;
std::ostream os(&sb);
os.imbue(std::locale("en_US.UTF-8"));
os.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0};
t.tm_sec = 59;
t.tm_min = 55;
@@ -66,7 +68,7 @@ int main()
{
testbuf<wchar_t> sb;
std::wostream os(&sb);
os.imbue(std::locale("en_US.UTF-8"));
os.imbue(std::locale(LOCALE_en_US_UTF_8));
std::tm t = {0};
t.tm_sec = 59;
t.tm_min = 55;