Skip to content

Commit 572ffd6

Browse files
committed
Extend printf tests with more %% corner cases
We've had a couple of bugs inside mesa/rusticl processing %% correctly. I've added those cases locally to make sure all corner cases are properly handled.
1 parent 2b26643 commit 572ffd6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test_conformance/printf/util_printf.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,12 @@ std::vector<printDataGenParameters> printStringGenParameters = {
724724

725725
{ {"%s"}, "\"%%\"" },
726726

727+
{ {"%s"}, "\"foo%%bar%%bar%%foo\"" },
728+
729+
{ {"%%%s%%"}, "\"foo\"" },
730+
731+
{ {"%%s%s"}, "\"foo\"" },
732+
727733
// special symbols
728734
// nested
729735

@@ -764,6 +770,12 @@ std::vector<std::string> correctBufferString = {
764770

765771
"%%",
766772

773+
"foo%%bar%%bar%%foo",
774+
775+
"%foo%",
776+
777+
"%sfoo",
778+
767779
"\"%%\"",
768780

769781
"\'%%\'",
@@ -819,6 +831,8 @@ std::vector<printDataGenParameters> printFormatStringGenParameters = {
819831

820832
{ {"\'%%\'"} },
821833

834+
{ {"\'foo%%bar%%bar%%foo\'"} },
835+
822836
// tabs
823837

824838
{ {"foo\\t\\t\\tfoo"} },
@@ -849,6 +863,8 @@ std::vector<std::string> correctBufferFormatString = {
849863

850864
"\'%\'",
851865

866+
"\'foo%bar%bar%foo\'",
867+
852868
"foo\t\t\tfoo",
853869

854870
R"(foo

0 commit comments

Comments
 (0)