2010-05-11 21:42:16 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2010-05-11 23:36:01 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <locale>
|
|
|
|
|
|
|
|
// static const locale& classic();
|
|
|
|
|
|
|
|
#include <locale>
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
void check(const std::locale& loc)
|
|
|
|
{
|
|
|
|
assert(std::has_facet<std::collate<char> >(loc));
|
|
|
|
assert(std::has_facet<std::collate<wchar_t> >(loc));
|
|
|
|
|
|
|
|
assert(std::has_facet<std::ctype<char> >(loc));
|
|
|
|
assert(std::has_facet<std::ctype<wchar_t> >(loc));
|
|
|
|
assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
|
|
|
|
|
|
|
|
assert((std::has_facet<std::moneypunct<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::money_get<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::money_get<wchar_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::money_put<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::money_put<wchar_t> >(loc)));
|
|
|
|
|
|
|
|
assert((std::has_facet<std::numpunct<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::num_get<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::num_get<wchar_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::num_put<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::num_put<wchar_t> >(loc)));
|
|
|
|
|
|
|
|
assert((std::has_facet<std::time_get<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::time_get<wchar_t> >(loc)));
|
|
|
|
assert((std::has_facet<std::time_put<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::time_put<wchar_t> >(loc)));
|
|
|
|
|
|
|
|
assert((std::has_facet<std::messages<char> >(loc)));
|
|
|
|
assert((std::has_facet<std::messages<wchar_t> >(loc)));
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
std::locale loc;
|
|
|
|
assert(loc.name() == "C");
|
|
|
|
check(loc);
|
|
|
|
assert(std::locale::global(std::locale("en_US")) == loc);
|
|
|
|
std::locale loc2;
|
|
|
|
check(loc2);
|
|
|
|
assert(loc2 == std::locale("en_US"));
|
|
|
|
}
|