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:
@@ -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 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user