#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
void test02()
{
using namespace std;
bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<wchar_t> iterator_type;
locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_de );
const wstring empty;
iterator_type end;
wistringstream iss;
const time_get<wchar_t>& tim_get = use_facet<time_get<wchar_t> >(iss.getloc());
const ios_base::iostate good = ios_base::goodbit;
ios_base::iostate errorstate = good;
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
iss.imbue(loc_de);
iss.str(L"Sonntag");
iterator_type is_it10(iss);
tm time10;
errorstate = good;
tim_get.get_weekday(is_it10, end, iss, errorstate, &time10);
VERIFY( time10.tm_wday == time_bday.tm_wday );
VERIFY( errorstate == ios_base::eofbit );
iss.imbue(loc_hk);
iss.str(L"Sunday");
iterator_type is_it20(iss);
tm time20;
errorstate = good;
tim_get.get_weekday(is_it20, end, iss, errorstate, &time20);
VERIFY( time20.tm_wday == time_bday.tm_wday );
VERIFY( errorstate == ios_base::eofbit );
}
int main()
{
test02();
return 0;
}