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
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <streambuf>
|
|
|
|
|
|
|
|
// template <class charT, class traits = char_traits<charT> >
|
|
|
|
// class basic_streambuf;
|
|
|
|
|
|
|
|
// basic_streambuf();
|
|
|
|
|
|
|
|
#include <streambuf>
|
|
|
|
#include <cassert>
|
|
|
|
|
2013-01-05 04:21:01 +01:00
|
|
|
#include "platform_support.h" // locale name macros
|
2011-10-03 17:23:59 +02:00
|
|
|
|
2010-05-11 21:42:16 +02:00
|
|
|
template <class CharT>
|
|
|
|
struct test
|
|
|
|
: public std::basic_streambuf<CharT>
|
|
|
|
{
|
|
|
|
test()
|
|
|
|
{
|
|
|
|
assert(this->eback() == 0);
|
|
|
|
assert(this->gptr() == 0);
|
|
|
|
assert(this->egptr() == 0);
|
|
|
|
assert(this->pbase() == 0);
|
|
|
|
assert(this->pptr() == 0);
|
|
|
|
assert(this->epptr() == 0);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
test<char> t;
|
|
|
|
assert(t.getloc().name() == "C");
|
|
|
|
}
|
|
|
|
{
|
|
|
|
test<wchar_t> t;
|
|
|
|
assert(t.getloc().name() == "C");
|
|
|
|
}
|
2011-10-03 17:23:59 +02:00
|
|
|
std::locale::global(std::locale(LOCALE_en_US_UTF_8));
|
2010-05-11 21:42:16 +02:00
|
|
|
{
|
|
|
|
test<char> t;
|
2011-10-03 17:23:59 +02:00
|
|
|
assert(t.getloc().name() == LOCALE_en_US_UTF_8);
|
2010-05-11 21:42:16 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
test<wchar_t> t;
|
2011-10-03 17:23:59 +02:00
|
|
|
assert(t.getloc().name() == LOCALE_en_US_UTF_8);
|
2010-05-11 21:42:16 +02:00
|
|
|
}
|
|
|
|
}
|