14#define PRINTF_TEST(expected, format, ...) \
17 if (MOS_TEST_CURRENT_TEST_SKIPPED) \
22 sprintf(buffer, format __VA_OPT__(, ) __VA_ARGS__); \
23 MOS_TEST_CHECK_STRING(buffer, expected); \
45 PRINTF_TEST(
"very long string",
"very long string", );
46 PRINTF_TEST(
"d6c40101-371d-473e-8880-464eeed9541cd6c40101-371d-473e-8880-464eeed9541cd6c40101-371d-473e-8880-464eeed9541cd6c40101-371d-473e-8880",
47 "d6c40101-371d-473e-8880-464eeed9541cd6c40101-371d-473e-8880-464eeed9541cd6c40101-371d-473e-8880-464eeed9541cd6c40101-371d-473e-8880", );
422 PRINTF_TEST(
" 0000000000000000000000000000000000000001",
"% .40d", 1);
471 PRINTF_TEST(
"0000000000000000000000000000000000000001",
"%.40lld", 1LL);
472 PRINTF_TEST(
" 0000000000000000000000000000000000000001",
"% .40lld", 1LL);
481 PRINTF_TEST(
" 4294966272",
"%*u", 20, 4294966272U);
502 PRINTF_TEST(
"Hallo heimur",
"%1s",
"Hallo heimur");
526 PRINTF_TEST(
"00000000000000001024",
"%020d", 1024);
527 PRINTF_TEST(
"-0000000000000001024",
"%020d", -1024);
528 PRINTF_TEST(
"00000000000000001024",
"%020i", 1024);
529 PRINTF_TEST(
"-0000000000000001024",
"%020i", -1024);
530 PRINTF_TEST(
"00000000000000001024",
"%020u", 1024);
531 PRINTF_TEST(
"00000000004294966272",
"%020u", 4294966272U);
532 PRINTF_TEST(
"Hallo heimur",
"%.20s",
"Hallo heimur");
533 PRINTF_TEST(
"00000000000000001024",
"%.20d", 1024);
534 PRINTF_TEST(
"-00000000000000001024",
"%.20d", -1024);
535 PRINTF_TEST(
"00000000000000001024",
"%.20i", 1024);
536 PRINTF_TEST(
"-00000000000000001024",
"%.20i", -1024);
537 PRINTF_TEST(
"00000000000000001024",
"%.20u", 1024);
538 PRINTF_TEST(
"00000000004294966272",
"%.20u", 4294966272U);
551 PRINTF_TEST(
" 4294966272",
"%020.5u", 4294966272U);
621 PRINTF_TEST(
"Hot Pocket",
"%1$s %2$s",
"Hot",
"Pocket");
622 PRINTF_TEST(
"12.0 Hot Pockets",
"%1$.1f %2$s %3$ss", 12.0,
"Hot",
"Pocket");
652 PRINTF_TEST(
"+7.894561230000000e+08",
"%+#22.15e", 7.89456123e8);
653 PRINTF_TEST(
"7.894561230000000e+08 ",
"%-#22.15e", 7.89456123e8);
654 PRINTF_TEST(
" 7.894561230000000e+08",
"%#22.15e", 7.89456123e8);
690 PRINTF_TEST(
" 37777777001",
"%*o", 20, 4294966785U);
708 PRINTF_TEST(
"00000000037777777001",
"%020o", 4294966785U);
709 PRINTF_TEST(
"0000000000001234abcd",
"%020x", 305441741);
710 PRINTF_TEST(
"000000000000edcb5433",
"%020x", 3989525555U);
711 PRINTF_TEST(
"0000000000001234ABCD",
"%020X", 305441741);
712 PRINTF_TEST(
"000000000000EDCB5433",
"%020X", 3989525555U);
714 PRINTF_TEST(
" 037777777001",
"%#20o", 4294966785U);
719 PRINTF_TEST(
"00000000000000000777",
"%#020o", 511);
720 PRINTF_TEST(
"00000000037777777001",
"%#020o", 4294966785U);
721 PRINTF_TEST(
"0x00000000001234abcd",
"%#020x", 305441741);
722 PRINTF_TEST(
"0x0000000000edcb5433",
"%#020x", 3989525555U);
723 PRINTF_TEST(
"0X00000000001234ABCD",
"%#020X", 305441741);
724 PRINTF_TEST(
"0X0000000000EDCB5433",
"%#020X", 3989525555U);
726 PRINTF_TEST(
"00000000037777777001",
"%.20o", 4294966785U);
727 PRINTF_TEST(
"0000000000001234abcd",
"%.20x", 305441741);
728 PRINTF_TEST(
"000000000000edcb5433",
"%.20x", 3989525555U);
729 PRINTF_TEST(
"0000000000001234ABCD",
"%.20X", 305441741);
730 PRINTF_TEST(
"000000000000EDCB5433",
"%.20X", 3989525555U);
732 PRINTF_TEST(
" 37777777001",
"%20.5o", 4294966785U);
734 PRINTF_TEST(
" 00edcb5433",
"%20.10x", 3989525555U);
736 PRINTF_TEST(
" 00EDCB5433",
"%20.10X", 3989525555U);
738 PRINTF_TEST(
" 37777777001",
"%020.5o", 4294966785U);
740 PRINTF_TEST(
" 00edcb5433",
"%020.10x", 3989525555U);
742 PRINTF_TEST(
" 00EDCB5433",
"%020.10X", 3989525555U);
749 PRINTF_TEST(
" 37777777001",
"%20.0o", 4294966785U);
752 PRINTF_TEST(
"0001777777777777777777634",
"%#.25llo", -100LL);
#define MOS_WARNING_DISABLE(text)
#define MOS_TEST_CASE(_TestName)
#define MOS_TEST_EXPECT_WARNING_N(N, body, msg)
#define MOS_TEST_DEFINE_CONDITION(condition, message)
#define MOS_TEST_EXPECT_WARNING(body, msg)
#define MOS_TEST_CONDITIONAL(cond)
#define PRINTF_TEST(expected, format,...)