From 572ffd6e42bb2894d1b4b30bc2604d6d1a2067e6 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 19 Jun 2024 15:45:54 +0200 Subject: [PATCH] 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. --- test_conformance/printf/util_printf.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test_conformance/printf/util_printf.cpp b/test_conformance/printf/util_printf.cpp index ca260573bb..29b7f8dc04 100644 --- a/test_conformance/printf/util_printf.cpp +++ b/test_conformance/printf/util_printf.cpp @@ -724,6 +724,12 @@ std::vector printStringGenParameters = { { {"%s"}, "\"%%\"" }, + { {"%s"}, "\"foo%%bar%%bar%%foo\"" }, + + { {"%%%s%%"}, "\"foo\"" }, + + { {"%%s%s"}, "\"foo\"" }, + // special symbols // nested @@ -764,6 +770,12 @@ std::vector correctBufferString = { "%%", + "foo%%bar%%bar%%foo", + + "%foo%", + + "%sfoo", + "\"%%\"", "\'%%\'", @@ -819,6 +831,8 @@ std::vector printFormatStringGenParameters = { { {"\'%%\'"} }, + { {"\'foo%%bar%%bar%%foo\'"} }, + // tabs { {"foo\\t\\t\\tfoo"} }, @@ -849,6 +863,8 @@ std::vector correctBufferFormatString = { "\'%\'", + "\'foo%bar%bar%foo\'", + "foo\t\t\tfoo", R"(foo