Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / libc++ / trunk / test / localization / locale.categories / facet.numpunct / locale.numpunct.byname / thousands_sep.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // REQUIRES: locale.en_US.UTF-8
11 // REQUIRES: locale.fr_FR.UTF-8
12
13 // <locale>
14
15 // template <class charT> class numpunct_byname;
16
17 // char_type thousands_sep() const;
18
19 #include <locale>
20 #include <cassert>
21
22 #include "platform_support.h" // locale name macros
23
24 int main()
25 {
26     {
27         std::locale l("C");
28         {
29             typedef char C;
30             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
31             assert(np.thousands_sep() == ',');
32         }
33         {
34             typedef wchar_t C;
35             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
36             assert(np.thousands_sep() == L',');
37         }
38     }
39     {
40         std::locale l(LOCALE_en_US_UTF_8);
41         {
42             typedef char C;
43             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
44             assert(np.thousands_sep() == ',');
45         }
46         {
47             typedef wchar_t C;
48             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
49             assert(np.thousands_sep() == L',');
50         }
51     }
52     {
53         std::locale l(LOCALE_fr_FR_UTF_8);
54         {
55             typedef char C;
56             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
57             assert(np.thousands_sep() == ',');
58         }
59         {
60             typedef wchar_t C;
61             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
62             assert(np.thousands_sep() == L',');
63         }
64     }
65 }