#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
void test02()
{
using namespace std;
typedef ostreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true;
locale loc_c = locale::classic();
const wstring empty;
wstring result1;
wstring result2;
bool b1 = true;
bool b0 = false;
unsigned long ul1 = 1294967294;
unsigned long ul2 = 0;
wostringstream oss;
oss.imbue(loc_c);
const num_put<wchar_t>& np = use_facet<num_put<wchar_t> >(oss.getloc());
oss.str(empty);
oss.width(20);
oss.setf(ios_base::right, ios_base::adjustfield);
np.put(oss.rdbuf(), oss, L'+', b0);
result1 = oss.str();
VERIFY( result1 == L"+++++++++++++++++++0" );
oss.str(empty);
oss.width(20);
oss.setf(ios_base::left, ios_base::adjustfield);
oss.setf(ios_base::boolalpha);
np.put(oss.rdbuf(), oss, L'+', b1);
result2 = oss.str();
VERIFY( result2 == L"true++++++++++++++++" );
oss.imbue(loc_c);
oss.str(empty);
oss.clear();
np.put(oss.rdbuf(), oss, L'+', ul1);
result1 = oss.str();
VERIFY( result1 == L"1294967294" );
oss.str(empty);
oss.clear();
oss.width(20);
oss.setf(ios_base::left, ios_base::adjustfield);
np.put(oss.rdbuf(), oss, L'+', ul2);
result1 = oss.str();
VERIFY( result1 == L"0+++++++++++++++++++" );
}
int main()
{
test02();
return 0;
}