id.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <locale>
11
12// class locale::id
13// {
14// public:
15//     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}
51