+
+void VarArgTestCase::Sscanf()
+{
+ int i = 0;
+ char str[20];
+ wchar_t wstr[20];
+
+ wxString input("42 test");
+
+ wxSscanf(input, "%d %s", &i, &str);
+ CPPUNIT_ASSERT( i == 42 );
+ CPPUNIT_ASSERT( wxStrcmp(str, "test") == 0 );
+
+ i = 0;
+ wxSscanf(input, L"%d %s", &i, &wstr);
+ 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);
+}