Check that missing format string arguments are detected

We now assert if not enough arguments are given to a vararg function, as
we can actually do it when checking it all at once, unlike before when
we only checked for the matching format specifier for each argument, so
add a test verifying that this works as expected.
This commit is contained in:
Vadim Zeitlin 2022-11-23 02:56:23 +01:00
parent ac4767c47f
commit 21549149f0

View file

@ -232,6 +232,7 @@ TEST_CASE("ArgsValidation", "[wxString][vararg][error]")
#endif
// but these are not:
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%d + %d = %d", 2, 2) );
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%i", "foo") );
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%s", (void*)&written) );
WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%d", ptr) );