CPPUNIT_TEST( StdString );
#endif
CPPUNIT_TEST( Sscanf );
+ CPPUNIT_TEST( RepeatedPrintf );
CPPUNIT_TEST_SUITE_END();
void StringPrintf();
void StdString();
#endif
void Sscanf();
+ void RepeatedPrintf();
DECLARE_NO_COPY_CLASS(VarArgTestCase)
};
CPPUNIT_ASSERT( i == 42 );
CPPUNIT_ASSERT( wxStrcmp(wstr, "test") == 0 );
}
+
+void VarArgTestCase::RepeatedPrintf()
+{
+ wxCharBuffer buffer(2);
+ char *p = buffer.data();
+ *p = 'h';
+ p++;
+ *p = 'i';
+
+ wxString s;
+ s = wxString::Format("buffer %s, len %d", buffer, wxStrlen(buffer));
+ CPPUNIT_ASSERT_EQUAL("buffer hi, len 2", s);
+
+ s = wxString::Format("buffer %s, len %d", buffer, wxStrlen(buffer));
+ CPPUNIT_ASSERT_EQUAL("buffer hi, len 2", s);
+}