tolower_many.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
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// template <> class ctype<char>;
13
14// const char* tolower(char* low, const char* high) const;
15
16#include <locale>
17#include <string>
18#include <cassert>
19
20int main()
21{
22    std::locale l = std::locale::classic();
23    {
24        typedef std::ctype<char> F;
25        const F& f = std::use_facet<F>(l);
26        std::string in(" A\x07.a1");
27
28        assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
29        assert(in[0] == ' ');
30        assert(in[1] == 'a');
31        assert(in[2] == '\x07');
32        assert(in[3] == '.');
33        assert(in[4] == 'a');
34        assert(in[5] == '1');
35    }
36}
37