blob: 3233624d87b44e2f725f3c6263641193874a98c2 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <locale>
11
12// class locale::id
13// {
Howard Hinnant22a74dc2010-08-22 00:39:25 +000014// public:
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000015// id();
16// void operator=(const id&) = delete;
17// id(const id&) = delete;
18// };
19
20// This test isn't portable
21
22#include <locale>
23#include <cassert>
24
25std::locale::id id0;
26std::locale::id id2;
27std::locale::id id1;
28
29int main()
30{
31 long id = id0.__get();
32 assert(id0.__get() == id+0);
33 assert(id0.__get() == id+0);
34 assert(id0.__get() == id+0);
35 assert(id1.__get() == id+1);
36 assert(id1.__get() == id+1);
37 assert(id1.__get() == id+1);
38 assert(id2.__get() == id+2);
39 assert(id2.__get() == id+2);
40 assert(id2.__get() == id+2);
41 assert(id0.__get() == id+0);
42 assert(id0.__get() == id+0);
43 assert(id0.__get() == id+0);
44 assert(id1.__get() == id+1);
45 assert(id1.__get() == id+1);
46 assert(id1.__get() == id+1);
47 assert(id2.__get() == id+2);
48 assert(id2.__get() == id+2);
49 assert(id2.__get() == id+2);
50}