wxSnprintf() and wxVsnprintf() added, documented and used in wxLog
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4572 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,8 +28,10 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// what to test?
|
||||
#define TEST_ARRAYS
|
||||
#undef TEST_THREADS
|
||||
|
||||
//#define TEST_ARRAYS
|
||||
#define TEST_LOG
|
||||
//#define TEST_THREADS
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
@@ -162,6 +164,23 @@ int main(int argc, char **argv)
|
||||
PrintArray("a3", a3);
|
||||
#endif // TEST_ARRAYS
|
||||
|
||||
#ifdef TEST_LOG
|
||||
wxString s;
|
||||
for ( size_t n = 0; n < 8000; n++ )
|
||||
{
|
||||
s << (char)('A' + (n % 26));
|
||||
}
|
||||
|
||||
wxString msg;
|
||||
msg.Printf("A very very long message: '%s', the end!\n", s.c_str());
|
||||
|
||||
// this one shouldn't be truncated
|
||||
printf(msg);
|
||||
|
||||
// but this one will because log functions use fixed size buffer
|
||||
wxLogMessage("A very very long message 2: '%s', the end!\n", s.c_str());
|
||||
#endif // TEST_LOG
|
||||
|
||||
#ifdef TEST_THREADS
|
||||
static const size_t nThreads = 3;
|
||||
MyThread *threads[nThreads];
|
||||
|
Reference in New Issue
Block a user