Add a check for using wxString::Format() with a very long string

This used to fail until it was fixed in the previous commit.

See #18586.
This commit is contained in:
Vadim Zeitlin
2019-11-16 17:08:15 +01:00
parent 8005c59615
commit 8cba51978e

View File

@@ -264,3 +264,16 @@ TEST_CASE("ArgsValidation", "[wxString][vararg][error]")
wxString::Format("%zu", len);
#endif
}
TEST_CASE("VeryLongArg", "[wxString][Format][vararg]")
{
const size_t LENGTH = 70000;
wxString veryLongString('.', LENGTH);
REQUIRE( veryLongString.length() == LENGTH );
const wxString s = wxString::Format("%s", veryLongString);
// Check the length first to avoid very long output if this fails.
REQUIRE( s.length() == LENGTH );
CHECK( s == veryLongString );
}