#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
void test01()
{
using namespace std;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
locale loc_c = locale::classic();
const wstring empty;
wostringstream oss;
oss.imbue(loc_c);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
oss.str(empty);
iterator_type os_it01 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a');
wstring result1 = oss.str();
VERIFY( result1 == L"Sun" );
oss.str(empty);
iterator_type os_it21 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x');
wstring result21 = oss.str(); VERIFY( result21 == L"04/04/71" );
oss.str(empty);
iterator_type os_it22 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X');
wstring result22 = oss.str(); VERIFY( result22 == L"12:00:00" );
oss.str(empty);
iterator_type os_it31 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E');
wstring result31 = oss.str(); VERIFY( result31 == L"04/04/71" );
oss.str(empty);
iterator_type os_it32 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E');
wstring result32 = oss.str(); VERIFY( result32 == L"12:00:00" );
}
int main()
{
test01();
return 0;
}