fix handling of % in our printf implementation (part of patch 1462778)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-06-27 14:21:15 +00:00
parent 42a3ecf573
commit 247c23b466
2 changed files with 44 additions and 8 deletions

View File

@@ -184,6 +184,11 @@ void VsnprintfTestCase::S()
CMP("abcdefghi", "%-5s", wxT("abcdefghi"));
CMP("abcde", "%.5s", wxT("abcdefghi"));
// some tests without any argument:
Compare(wxT("%"), wxT("%%"));
Compare(wxT("%%%"), wxT("%%%%%%"));
Compare(wxT("%%"), wxT("%%%"));
}
void VsnprintfTestCase::Misc(wxChar *buffer, int size)
@@ -197,7 +202,7 @@ void VsnprintfTestCase::Misc(wxChar *buffer, int size)
if (ret >= 0)
{
CPPUNIT_ASSERT_STR_EQUAL(
wxT("\n\naa 1.231230e+102 1.231231e+123 456 33333333 - test - 789 999 %% - 0.1-\n\n"),
wxT("\n\naa 1.231230e+102 1.231231e+123 456 33333333 - test - 789 999 % - 0.1-\n\n"),
buffer);
}
@@ -208,7 +213,7 @@ void VsnprintfTestCase::Misc(wxChar *buffer, int size)
if (ret >= 0)
{
CPPUNIT_ASSERT_STR_EQUAL(
wxT("\n\naa 1.231230e+102 1.231231e+123 456 33333333 - test - 789 999 %% 0.1231\n\n"),
wxT("\n\naa 1.231230e+102 1.231231e+123 456 33333333 - test - 789 999 % 0.1231\n\n"),
buffer);
}