summaryrefslogtreecommitdiff
path: root/src/systemc/tests/systemc/datatypes/int/string_conversion/test03/test03.cpp
blob: a075ba5252bef72710923a0d31534383f61e715e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "systemc.h"

inline void flags_value()
{
	ios::fmtflags flags = cout.flags();
	cout << hex << flags << dec << endl;
	if ( sc_io_show_base(cout) ) cout << "showbase" << endl;
}

#define TEST(BASE) \
{ \
	BASE x; \
	cout << endl << #BASE << endl; \
	for ( i = 0; i < 256; i++ ) \
	{ \
		x = i; \
		cout << "   "; \
		cout << std::noshowbase; \
		cout << dec << " d: " << x; \
		cout << oct << " o: " << x; \
		cout << hex << " x: " << x; \
		cout << std::showbase; \
		cout << dec << " d: " << x; \
		cout << oct << " o: " << x; \
		cout << hex << " x: " << x; \
		cout << endl; \
	} \
}
int sc_main(int argc, char* argv[])
{
	int           i;
	sc_biguint<8> x;

	TEST(sc_bigint<8>)
	TEST(sc_biguint<8>)
	TEST(sc_int<8>)
	TEST(sc_uint<8>)
	TEST(sc_lv<8>)
	TEST(sc_bv<8>)
	cerr << "Program completed" << endl;

	return 0;
}