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