Home | History | Annotate | Download | only in Support

Lines Matching refs:printToString

19 template<typename T> std::string printToString(const T &Value) {
25 /// printToString - Print the given value to a stream which only has \arg
28 template<typename T> std::string printToString(const T &Value,
52 EXPECT_EQ("c", printToString('c'));
55 EXPECT_EQ("hello", printToString("hello"));
56 EXPECT_EQ("hello", printToString(std::string("hello")));
59 EXPECT_EQ("0", printToString(0));
60 EXPECT_EQ("2425", printToString(2425));
61 EXPECT_EQ("-2425", printToString(-2425));
64 EXPECT_EQ("0", printToString(0LL));
65 EXPECT_EQ("257257257235709", printToString(257257257235709LL));
66 EXPECT_EQ("-257257257235709", printToString(-257257257235709LL));
69 EXPECT_EQ("1.100000e+00", printToString(1.1));
72 EXPECT_EQ("0x0", printToString((void*) nullptr));
73 EXPECT_EQ("0xbeef", printToString((void*) 0xbeef));
74 EXPECT_EQ("0xdeadbeef", printToString((void*) 0xdeadbeef));
77 EXPECT_EQ("18446744073709551615", printToString(UINT64_MAX));
78 EXPECT_EQ("-9223372036854775808", printToString(INT64_MIN));
113 EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 1));
114 EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 2));
115 EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 3));
116 EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 4));
117 EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 10));
147 EXPECT_EQ("xyz ", printToString(left_justify("xyz", 6), 6));
148 EXPECT_EQ("abc", printToString(left_justify("abc", 3), 3));
149 EXPECT_EQ("big", printToString(left_justify("big", 1), 3));
150 EXPECT_EQ(" xyz", printToString(right_justify("xyz", 6), 6));
151 EXPECT_EQ("abc", printToString(right_justify("abc", 3), 3));
152 EXPECT_EQ("big", printToString(right_justify("big", 1), 3));
156 EXPECT_EQ("0x1234", printToString(format_hex(0x1234, 6), 6));
157 EXPECT_EQ("0x001234", printToString(format_hex(0x1234, 8), 8));
158 EXPECT_EQ("0x00001234", printToString(format_hex(0x1234, 10), 10));
159 EXPECT_EQ("0x1234", printToString(format_hex(0x1234, 4), 6));
160 EXPECT_EQ("0xff", printToString(format_hex(255, 4), 4));
161 EXPECT_EQ("0xFF", printToString(format_hex(255, 4, true), 4));
162 EXPECT_EQ("0x1", printToString(format_hex(1, 3), 3));
163 EXPECT_EQ("0x12", printToString(format_hex(0x12, 3), 4));
164 EXPECT_EQ("0x123", printToString(format_hex(0x123, 3), 5));
165 EXPECT_EQ("FF", printToString(format_hex_no_prefix(0xFF, 2, true), 4));
166 EXPECT_EQ("ABCD", printToString(format_hex_no_prefix(0xABCD, 2, true), 4));
168 printToString(format_hex(UINT64_MAX, 18), 18));
170 printToString(format_hex((INT64_MIN), 18), 18));
174 EXPECT_EQ(" 0", printToString(format_decimal(0, 4), 4));
175 EXPECT_EQ(" -1", printToString(format_decimal(-1, 4), 4));
176 EXPECT_EQ(" -1", printToString(format_decimal(-1, 6), 6));
177 EXPECT_EQ("1234567890", printToString(format_decimal(1234567890, 10), 10));
179 printToString(format_decimal(INT64_MAX, 21), 21));
181 printToString(format_decimal(INT64_MIN, 21), 21));