Allow passing wxLongLong values directly to wx pseudo-vararg functions.

Allow passing wxLongLong objects when a "%lld" format specifier (or
equivalent) is used just as we already do for wxString objects when "%s" is
used. This is more convenient and makes wxLongLong closes to the native type.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-05-17 22:12:39 +00:00
parent 8ea26eedce
commit 715efa4e25
3 changed files with 46 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ private:
CPPUNIT_TEST( CharPrintf );
#if wxUSE_STD_STRING
CPPUNIT_TEST( StdString );
#endif
#if wxUSE_LONGLONG
CPPUNIT_TEST( LongLongPrintf );
#endif
CPPUNIT_TEST( Sscanf );
CPPUNIT_TEST( RepeatedPrintf );
@@ -49,6 +52,9 @@ private:
void CharPrintf();
#if wxUSE_STD_STRING
void StdString();
#endif
#if wxUSE_LONGLONG
void LongLongPrintf();
#endif
void Sscanf();
void RepeatedPrintf();
@@ -152,6 +158,18 @@ void VarArgTestCase::StdString()
}
#endif // wxUSE_STD_STRING
#if wxUSE_LONGLONG
void VarArgTestCase::LongLongPrintf()
{
const char * const llfmt = "%" wxLongLongFmtSpec "d";
CPPUNIT_ASSERT_EQUAL( "17", wxString::Format(llfmt, wxLL(17)) );
wxLongLong ll = 1234567890;
CPPUNIT_ASSERT_EQUAL( "1234567890", wxString::Format(llfmt, ll) );
}
#endif // wxUSE_LONGLONG
void VarArgTestCase::Sscanf()
{
int i = 0;