Lines Matching refs:EXPECT_EQ
34 EXPECT_EQ(-1, SafeSNPrintf(buf, static_cast<size_t>(-1), "")); in TEST()
35 EXPECT_EQ('X', buf[0]); in TEST()
36 EXPECT_EQ('X', buf[1]); in TEST()
39 EXPECT_EQ(-1, SafeSNPrintf(buf, 0, "")); in TEST()
40 EXPECT_EQ('X', buf[0]); in TEST()
41 EXPECT_EQ('X', buf[1]); in TEST()
44 EXPECT_EQ(0, SafeSNPrintf(buf, 1, "")); in TEST()
45 EXPECT_EQ(0, buf[0]); in TEST()
46 EXPECT_EQ('X', buf[1]); in TEST()
50 EXPECT_EQ(0, SafeSNPrintf(buf, 2, "")); in TEST()
51 EXPECT_EQ(0, buf[0]); in TEST()
52 EXPECT_EQ('X', buf[1]); in TEST()
56 EXPECT_EQ(0, SafeSPrintf(buf, "")); in TEST()
57 EXPECT_EQ(0, buf[0]); in TEST()
58 EXPECT_EQ('X', buf[1]); in TEST()
72 EXPECT_EQ(-1, SafeSNPrintf(buf, static_cast<size_t>(-1), text)); in TEST()
76 EXPECT_EQ(-1, SafeSNPrintf(buf, 0, text)); in TEST()
80 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, SafeSNPrintf(buf, 1, text)); in TEST()
81 EXPECT_EQ(0, buf[0]); in TEST()
87 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, SafeSNPrintf(buf, 2, text)); in TEST()
88 EXPECT_EQ(text[0], buf[0]); in TEST()
89 EXPECT_EQ(0, buf[1]); in TEST()
95 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, in TEST()
97 EXPECT_EQ(std::string(text), std::string(buf)); in TEST()
103 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, SafeSPrintf(buf, text)); in TEST()
104 EXPECT_EQ(std::string(text), std::string(buf)); in TEST()
110 EXPECT_EQ(1, SafeSPrintf(buf, "%%")); in TEST()
111 EXPECT_EQ(2, SafeSPrintf(buf, "%%%%")); in TEST()
112 EXPECT_EQ(2, SafeSPrintf(buf, "%%X")); in TEST()
113 EXPECT_EQ(3, SafeSPrintf(buf, "%%%%X")); in TEST()
115 EXPECT_EQ(1, SafeSPrintf(buf, "%")); in TEST()
116 EXPECT_EQ(2, SafeSPrintf(buf, "%%%")); in TEST()
117 EXPECT_EQ(2, SafeSPrintf(buf, "%X")); in TEST()
118 EXPECT_EQ(3, SafeSPrintf(buf, "%%%X")); in TEST()
136 EXPECT_EQ(-1, SafeSNPrintf(buf, static_cast<size_t>(-1), fmt, ' ')); in TEST()
140 EXPECT_EQ(-1, SafeSNPrintf(buf, 0, fmt, ' ')); in TEST()
144 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, in TEST()
146 EXPECT_EQ(0, buf[0]); in TEST()
152 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, in TEST()
154 EXPECT_EQ(text[0], buf[0]); in TEST()
155 EXPECT_EQ(0, buf[1]); in TEST()
161 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, in TEST()
163 EXPECT_EQ(std::string(text), std::string(buf)); in TEST()
169 EXPECT_EQ(static_cast<ssize_t>(sizeof(text))-1, SafeSPrintf(buf, fmt, ' ')); in TEST()
170 EXPECT_EQ(std::string(text), std::string(buf)); in TEST()
176 EXPECT_EQ(1, SafeSPrintf(buf, "%%", 0)); in TEST()
177 EXPECT_EQ(2, SafeSPrintf(buf, "%%%%", 0)); in TEST()
178 EXPECT_EQ(2, SafeSPrintf(buf, "%Y", 0)); in TEST()
179 EXPECT_EQ(2, SafeSPrintf(buf, "%%Y", 0)); in TEST()
180 EXPECT_EQ(3, SafeSPrintf(buf, "%%%Y", 0)); in TEST()
181 EXPECT_EQ(3, SafeSPrintf(buf, "%%%%Y", 0)); in TEST()
183 EXPECT_EQ(1, SafeSPrintf(buf, "%", 0)); in TEST()
184 EXPECT_EQ(2, SafeSPrintf(buf, "%%%", 0)); in TEST()
194 EXPECT_EQ(3, SafeSPrintf(buf, "%c%c", 'A')); in TEST()
195 EXPECT_EQ("A%c", std::string(buf)); in TEST()
209 EXPECT_EQ(static_cast<ssize_t>(sizeof(kTestString) - 1), in TEST()
211 EXPECT_EQ(std::string(kTestString), std::string(buf.get())); in TEST()
212 EXPECT_EQ(static_cast<ssize_t>(sizeof(kTestString) - 1), in TEST()
214 EXPECT_EQ(std::string(kTestString), std::string(buf.get())); in TEST()
224 EXPECT_EQ(1, SafeSPrintf(buf, "%c", 1)); in TEST()
225 EXPECT_EQ("\1", std::string(buf)); in TEST()
226 EXPECT_EQ(2, SafeSPrintf(buf, "%c%c", 1, 2)); in TEST()
227 EXPECT_EQ("\1\2", std::string(buf)); in TEST()
228 EXPECT_EQ(3, SafeSPrintf(buf, "%c%c%c", 1, 2, 3)); in TEST()
229 EXPECT_EQ("\1\2\3", std::string(buf)); in TEST()
230 EXPECT_EQ(4, SafeSPrintf(buf, "%c%c%c%c", 1, 2, 3, 4)); in TEST()
231 EXPECT_EQ("\1\2\3\4", std::string(buf)); in TEST()
232 EXPECT_EQ(5, SafeSPrintf(buf, "%c%c%c%c%c", 1, 2, 3, 4, 5)); in TEST()
233 EXPECT_EQ("\1\2\3\4\5", std::string(buf)); in TEST()
234 EXPECT_EQ(6, SafeSPrintf(buf, "%c%c%c%c%c%c", 1, 2, 3, 4, 5, 6)); in TEST()
235 EXPECT_EQ("\1\2\3\4\5\6", std::string(buf)); in TEST()
236 EXPECT_EQ(7, SafeSPrintf(buf, "%c%c%c%c%c%c%c", 1, 2, 3, 4, 5, 6, 7)); in TEST()
237 EXPECT_EQ("\1\2\3\4\5\6\7", std::string(buf)); in TEST()
238 EXPECT_EQ(8, SafeSPrintf(buf, "%c%c%c%c%c%c%c%c", 1, 2, 3, 4, 5, 6, 7, 8)); in TEST()
239 EXPECT_EQ("\1\2\3\4\5\6\7\10", std::string(buf)); in TEST()
240 EXPECT_EQ(9, SafeSPrintf(buf, "%c%c%c%c%c%c%c%c%c", in TEST()
242 EXPECT_EQ("\1\2\3\4\5\6\7\10\11", std::string(buf)); in TEST()
243 EXPECT_EQ(10, SafeSPrintf(buf, "%c%c%c%c%c%c%c%c%c%c", in TEST()
247 EXPECT_EQ("\1\2\3\4\5\6\7\10\11\12", std::string(buf)); in TEST()
248 EXPECT_EQ(1, SafeSNPrintf(buf, 11, "%c", 1)); in TEST()
249 EXPECT_EQ("\1", std::string(buf)); in TEST()
250 EXPECT_EQ(2, SafeSNPrintf(buf, 11, "%c%c", 1, 2)); in TEST()
251 EXPECT_EQ("\1\2", std::string(buf)); in TEST()
252 EXPECT_EQ(3, SafeSNPrintf(buf, 11, "%c%c%c", 1, 2, 3)); in TEST()
253 EXPECT_EQ("\1\2\3", std::string(buf)); in TEST()
254 EXPECT_EQ(4, SafeSNPrintf(buf, 11, "%c%c%c%c", 1, 2, 3, 4)); in TEST()
255 EXPECT_EQ("\1\2\3\4", std::string(buf)); in TEST()
256 EXPECT_EQ(5, SafeSNPrintf(buf, 11, "%c%c%c%c%c", 1, 2, 3, 4, 5)); in TEST()
257 EXPECT_EQ("\1\2\3\4\5", std::string(buf)); in TEST()
258 EXPECT_EQ(6, SafeSNPrintf(buf, 11, "%c%c%c%c%c%c", 1, 2, 3, 4, 5, 6)); in TEST()
259 EXPECT_EQ("\1\2\3\4\5\6", std::string(buf)); in TEST()
260 EXPECT_EQ(7, SafeSNPrintf(buf, 11, "%c%c%c%c%c%c%c", 1, 2, 3, 4, 5, 6, 7)); in TEST()
261 EXPECT_EQ("\1\2\3\4\5\6\7", std::string(buf)); in TEST()
262 EXPECT_EQ(8, SafeSNPrintf(buf, 11, "%c%c%c%c%c%c%c%c", in TEST()
264 EXPECT_EQ("\1\2\3\4\5\6\7\10", std::string(buf)); in TEST()
265 EXPECT_EQ(9, SafeSNPrintf(buf, 11, "%c%c%c%c%c%c%c%c%c", in TEST()
267 EXPECT_EQ("\1\2\3\4\5\6\7\10\11", std::string(buf)); in TEST()
268 EXPECT_EQ(10, SafeSNPrintf(buf, 11, "%c%c%c%c%c%c%c%c%c%c", in TEST()
270 EXPECT_EQ("\1\2\3\4\5\6\7\10\11\12", std::string(buf)); in TEST()
272 EXPECT_EQ(11, SafeSPrintf(buf, "%c%c%c%c%c%c%c%c%c%c%c", in TEST()
274 EXPECT_EQ("\1\2\3\4\5\6\7\10\11\12\13", std::string(buf)); in TEST()
275 EXPECT_EQ(11, SafeSNPrintf(buf, 12, "%c%c%c%c%c%c%c%c%c%c%c", in TEST()
277 EXPECT_EQ("\1\2\3\4\5\6\7\10\11\12\13", std::string(buf)); in TEST()
284 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (uint8_t)1)); in TEST()
285 EXPECT_EQ("1", std::string(buf)); in TEST()
286 EXPECT_EQ(3, SafeSPrintf(buf, "%d", (uint8_t)-1)); in TEST()
287 EXPECT_EQ("255", std::string(buf)); in TEST()
288 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (int8_t)1)); in TEST()
289 EXPECT_EQ("1", std::string(buf)); in TEST()
290 EXPECT_EQ(2, SafeSPrintf(buf, "%d", (int8_t)-1)); in TEST()
291 EXPECT_EQ("-1", std::string(buf)); in TEST()
292 EXPECT_EQ(4, SafeSPrintf(buf, "%d", (int8_t)-128)); in TEST()
293 EXPECT_EQ("-128", std::string(buf)); in TEST()
296 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (uint16_t)1)); in TEST()
297 EXPECT_EQ("1", std::string(buf)); in TEST()
298 EXPECT_EQ(5, SafeSPrintf(buf, "%d", (uint16_t)-1)); in TEST()
299 EXPECT_EQ("65535", std::string(buf)); in TEST()
300 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (int16_t)1)); in TEST()
301 EXPECT_EQ("1", std::string(buf)); in TEST()
302 EXPECT_EQ(2, SafeSPrintf(buf, "%d", (int16_t)-1)); in TEST()
303 EXPECT_EQ("-1", std::string(buf)); in TEST()
304 EXPECT_EQ(6, SafeSPrintf(buf, "%d", (int16_t)-32768)); in TEST()
305 EXPECT_EQ("-32768", std::string(buf)); in TEST()
308 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (uint32_t)1)); in TEST()
309 EXPECT_EQ("1", std::string(buf)); in TEST()
310 EXPECT_EQ(10, SafeSPrintf(buf, "%d", (uint32_t)-1)); in TEST()
311 EXPECT_EQ("4294967295", std::string(buf)); in TEST()
312 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (int32_t)1)); in TEST()
313 EXPECT_EQ("1", std::string(buf)); in TEST()
314 EXPECT_EQ(2, SafeSPrintf(buf, "%d", (int32_t)-1)); in TEST()
315 EXPECT_EQ("-1", std::string(buf)); in TEST()
317 EXPECT_EQ(11, SafeSPrintf(buf, "%d", (int32_t)-2147483647-1)); in TEST()
318 EXPECT_EQ("-2147483648", std::string(buf)); in TEST()
321 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (uint64_t)1)); in TEST()
322 EXPECT_EQ("1", std::string(buf)); in TEST()
323 EXPECT_EQ(20, SafeSPrintf(buf, "%d", (uint64_t)-1)); in TEST()
324 EXPECT_EQ("18446744073709551615", std::string(buf)); in TEST()
325 EXPECT_EQ(1, SafeSPrintf(buf, "%d", (int64_t)1)); in TEST()
326 EXPECT_EQ("1", std::string(buf)); in TEST()
327 EXPECT_EQ(2, SafeSPrintf(buf, "%d", (int64_t)-1)); in TEST()
328 EXPECT_EQ("-1", std::string(buf)); in TEST()
330 EXPECT_EQ(20, SafeSPrintf(buf, "%d", (int64_t)-9223372036854775807LL-1)); in TEST()
331 EXPECT_EQ("-9223372036854775808", std::string(buf)); in TEST()
334 EXPECT_EQ(4, SafeSPrintf(buf, "test")); in TEST()
335 EXPECT_EQ("test", std::string(buf)); in TEST()
336 EXPECT_EQ(4, SafeSPrintf(buf, buf)); in TEST()
337 EXPECT_EQ("test", std::string(buf)); in TEST()
343 EXPECT_EQ(std::string(addr), std::string(buf)); in TEST()
345 EXPECT_EQ(std::string(addr), std::string(buf)); in TEST()
348 EXPECT_EQ(std::string(addr), std::string(buf)); in TEST()
355 EXPECT_EQ(std::string(addr), std::string(buf)); in TEST()
361 EXPECT_EQ(std::string(addr), std::string(buf)); in TEST()
428 EXPECT_EQ('X', tmp[i]); in PrintLongString()
453 EXPECT_EQ(std::string(ref).substr(0, kSSizeMax-1), std::string(tmp.get())); in PrintLongString()
492 EXPECT_EQ(std::string(ref, i - 1), std::string(buf)); in TEST()
506 EXPECT_EQ(std::string(ref, i - 1), std::string(buf)); in TEST()
513 EXPECT_EQ(99, SafeSPrintf(buf, "%99c", ' ')); in TEST()
514 EXPECT_EQ(std::string(99, ' '), std::string(buf)); in TEST()
519 EXPECT_EQ(0, *buf); in TEST()
527 EXPECT_EQ(1, SafeSPrintf(buf, "%c", 'A')); in TEST()
528 EXPECT_EQ("A", std::string(buf)); in TEST()
529 EXPECT_EQ(2, SafeSPrintf(buf, "%2c", 'A')); in TEST()
530 EXPECT_EQ(" A", std::string(buf)); in TEST()
531 EXPECT_EQ(2, SafeSPrintf(buf, "%02c", 'A')); in TEST()
532 EXPECT_EQ(" A", std::string(buf)); in TEST()
533 EXPECT_EQ(4, SafeSPrintf(buf, "%-2c", 'A')); in TEST()
534 EXPECT_EQ("%-2c", std::string(buf)); in TEST()
536 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, SafeSPrintf(buf, fmt, 'A')); in TEST()
540 EXPECT_EQ(2, SafeSPrintf(buf, fmt, 'A')); in TEST()
541 EXPECT_EQ("%c", std::string(buf)); in TEST()
547 EXPECT_EQ(1, SafeSPrintf(buf, "%o", 1)); in TEST()
548 EXPECT_EQ("1", std::string(buf)); in TEST()
549 EXPECT_EQ(2, SafeSPrintf(buf, "%2o", 1)); in TEST()
550 EXPECT_EQ(" 1", std::string(buf)); in TEST()
551 EXPECT_EQ(2, SafeSPrintf(buf, "%02o", 1)); in TEST()
552 EXPECT_EQ("01", std::string(buf)); in TEST()
553 EXPECT_EQ(12, SafeSPrintf(buf, "%12o", -1)); in TEST()
554 EXPECT_EQ(" 37777777777", std::string(buf)); in TEST()
555 EXPECT_EQ(12, SafeSPrintf(buf, "%012o", -1)); in TEST()
556 EXPECT_EQ("037777777777", std::string(buf)); in TEST()
557 EXPECT_EQ(23, SafeSPrintf(buf, "%23o", -1LL)); in TEST()
558 EXPECT_EQ(" 1777777777777777777777", std::string(buf)); in TEST()
559 EXPECT_EQ(23, SafeSPrintf(buf, "%023o", -1LL)); in TEST()
560 EXPECT_EQ("01777777777777777777777", std::string(buf)); in TEST()
561 EXPECT_EQ(3, SafeSPrintf(buf, "%2o", 0111)); in TEST()
562 EXPECT_EQ("111", std::string(buf)); in TEST()
563 EXPECT_EQ(4, SafeSPrintf(buf, "%-2o", 1)); in TEST()
564 EXPECT_EQ("%-2o", std::string(buf)); in TEST()
566 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
568 EXPECT_EQ(" ", std::string(buf)); in TEST()
570 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
572 EXPECT_EQ("000", std::string(buf)); in TEST()
576 EXPECT_EQ(2, SafeSPrintf(buf, fmt, 1)); in TEST()
577 EXPECT_EQ("%o", std::string(buf)); in TEST()
583 EXPECT_EQ(1, SafeSPrintf(buf, "%d", 1)); in TEST()
584 EXPECT_EQ("1", std::string(buf)); in TEST()
585 EXPECT_EQ(2, SafeSPrintf(buf, "%2d", 1)); in TEST()
586 EXPECT_EQ(" 1", std::string(buf)); in TEST()
587 EXPECT_EQ(2, SafeSPrintf(buf, "%02d", 1)); in TEST()
588 EXPECT_EQ("01", std::string(buf)); in TEST()
589 EXPECT_EQ(3, SafeSPrintf(buf, "%3d", -1)); in TEST()
590 EXPECT_EQ(" -1", std::string(buf)); in TEST()
591 EXPECT_EQ(3, SafeSPrintf(buf, "%03d", -1)); in TEST()
592 EXPECT_EQ("-01", std::string(buf)); in TEST()
593 EXPECT_EQ(3, SafeSPrintf(buf, "%2d", 111)); in TEST()
594 EXPECT_EQ("111", std::string(buf)); in TEST()
595 EXPECT_EQ(4, SafeSPrintf(buf, "%2d", -111)); in TEST()
596 EXPECT_EQ("-111", std::string(buf)); in TEST()
597 EXPECT_EQ(4, SafeSPrintf(buf, "%-2d", 1)); in TEST()
598 EXPECT_EQ("%-2d", std::string(buf)); in TEST()
600 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
602 EXPECT_EQ(" ", std::string(buf)); in TEST()
604 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
606 EXPECT_EQ("000", std::string(buf)); in TEST()
610 EXPECT_EQ(2, SafeSPrintf(buf, fmt, 1)); in TEST()
611 EXPECT_EQ("%d", std::string(buf)); in TEST()
617 EXPECT_EQ(1, SafeSPrintf(buf, "%X", 1)); in TEST()
618 EXPECT_EQ("1", std::string(buf)); in TEST()
619 EXPECT_EQ(2, SafeSPrintf(buf, "%2X", 1)); in TEST()
620 EXPECT_EQ(" 1", std::string(buf)); in TEST()
621 EXPECT_EQ(2, SafeSPrintf(buf, "%02X", 1)); in TEST()
622 EXPECT_EQ("01", std::string(buf)); in TEST()
623 EXPECT_EQ(9, SafeSPrintf(buf, "%9X", -1)); in TEST()
624 EXPECT_EQ(" FFFFFFFF", std::string(buf)); in TEST()
625 EXPECT_EQ(9, SafeSPrintf(buf, "%09X", -1)); in TEST()
626 EXPECT_EQ("0FFFFFFFF", std::string(buf)); in TEST()
627 EXPECT_EQ(17, SafeSPrintf(buf, "%17X", -1LL)); in TEST()
628 EXPECT_EQ(" FFFFFFFFFFFFFFFF", std::string(buf)); in TEST()
629 EXPECT_EQ(17, SafeSPrintf(buf, "%017X", -1LL)); in TEST()
630 EXPECT_EQ("0FFFFFFFFFFFFFFFF", std::string(buf)); in TEST()
631 EXPECT_EQ(3, SafeSPrintf(buf, "%2X", 0x111)); in TEST()
632 EXPECT_EQ("111", std::string(buf)); in TEST()
633 EXPECT_EQ(4, SafeSPrintf(buf, "%-2X", 1)); in TEST()
634 EXPECT_EQ("%-2X", std::string(buf)); in TEST()
636 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
638 EXPECT_EQ(" ", std::string(buf)); in TEST()
640 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
642 EXPECT_EQ("000", std::string(buf)); in TEST()
646 EXPECT_EQ(2, SafeSPrintf(buf, fmt, 1)); in TEST()
647 EXPECT_EQ("%X", std::string(buf)); in TEST()
653 EXPECT_EQ(3, SafeSPrintf(buf, "%p", (void*)1)); in TEST()
654 EXPECT_EQ("0x1", std::string(buf)); in TEST()
655 EXPECT_EQ(4, SafeSPrintf(buf, "%4p", (void*)1)); in TEST()
656 EXPECT_EQ(" 0x1", std::string(buf)); in TEST()
657 EXPECT_EQ(4, SafeSPrintf(buf, "%04p", (void*)1)); in TEST()
658 EXPECT_EQ("0x01", std::string(buf)); in TEST()
659 EXPECT_EQ(5, SafeSPrintf(buf, "%4p", (void*)0x111)); in TEST()
660 EXPECT_EQ("0x111", std::string(buf)); in TEST()
661 EXPECT_EQ(4, SafeSPrintf(buf, "%-2p", (void*)1)); in TEST()
662 EXPECT_EQ("%-2p", std::string(buf)); in TEST()
664 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
666 EXPECT_EQ(" ", std::string(buf)); in TEST()
668 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
670 EXPECT_EQ("0x0", std::string(buf)); in TEST()
674 EXPECT_EQ(2, SafeSPrintf(buf, fmt, 1)); in TEST()
675 EXPECT_EQ("%p", std::string(buf)); in TEST()
681 EXPECT_EQ(1, SafeSPrintf(buf, "%s", "A")); in TEST()
682 EXPECT_EQ("A", std::string(buf)); in TEST()
683 EXPECT_EQ(2, SafeSPrintf(buf, "%2s", "A")); in TEST()
684 EXPECT_EQ(" A", std::string(buf)); in TEST()
685 EXPECT_EQ(2, SafeSPrintf(buf, "%02s", "A")); in TEST()
686 EXPECT_EQ(" A", std::string(buf)); in TEST()
687 EXPECT_EQ(3, SafeSPrintf(buf, "%2s", "AAA")); in TEST()
688 EXPECT_EQ("AAA", std::string(buf)); in TEST()
689 EXPECT_EQ(4, SafeSPrintf(buf, "%-2s", "A")); in TEST()
690 EXPECT_EQ("%-2s", std::string(buf)); in TEST()
692 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
694 EXPECT_EQ(" ", std::string(buf)); in TEST()
696 EXPECT_EQ(std::numeric_limits<ssize_t>::max()-1, in TEST()
698 EXPECT_EQ(" ", std::string(buf)); in TEST()
702 EXPECT_EQ(2, SafeSPrintf(buf, fmt, "A")); in TEST()
703 EXPECT_EQ("%s", std::string(buf)); in TEST()
711 EXPECT_EQ(2, SafeSPrintf(buf, "%3c", 0)); in TEST()
712 EXPECT_EQ(' ', buf[0]); in TEST()
713 EXPECT_EQ(' ', buf[1]); in TEST()
714 EXPECT_EQ(0, buf[2]); in TEST()
715 EXPECT_EQ('X', buf[3]); in TEST()
722 EXPECT_EQ(2, SafeSPrintf(buf, "%%%")); in TEST()
723 EXPECT_EQ("%%", std::string(buf)); in TEST()
724 EXPECT_EQ(2, SafeSPrintf(buf, "%%%", 0)); in TEST()
725 EXPECT_EQ("%%", std::string(buf)); in TEST()
738 EXPECT_EQ(1, SafeSPrintf(buf, "%d", NULL)); in TEST()
739 EXPECT_EQ("0", std::string(buf)); in TEST()
740 EXPECT_EQ(3, SafeSPrintf(buf, "%p", NULL)); in TEST()
741 EXPECT_EQ("0x0", std::string(buf)); in TEST()
742 EXPECT_EQ(6, SafeSPrintf(buf, "%s", NULL)); in TEST()
743 EXPECT_EQ("<NULL>", std::string(buf)); in TEST()
758 EXPECT_EQ(10, SafeSPrintf(buf, "%p", str)); in TEST()
759 EXPECT_EQ("0x80000000", std::string(buf)); in TEST()
760 EXPECT_EQ(10, SafeSPrintf(buf, "%p", ptr)); in TEST()
761 EXPECT_EQ("0x80000000", std::string(buf)); in TEST()