Use printf() instead of wxPrintf() in cppunit details listener.

Wide char output from wxPrintf() didn't appear at all under Linux because
stdout was switched into narrow stream mode by GNU libc due to initial use of
cout in the test.

Use printf() instead of wxPrintf() as we are only printing ASCII strings
anyhow. Of course, this is not a real fix but at least we can see the tests
results like this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-06-01 16:21:03 +00:00
parent 7d35d3ed3c
commit e84d989930

View File

@@ -231,7 +231,7 @@ public:
virtual void startTest(CppUnit::Test *test) virtual void startTest(CppUnit::Test *test)
{ {
wxPrintf(" %-60s ", test->getName()); printf(" %-60s ", test->getName().c_str());
m_result = RESULT_OK; m_result = RESULT_OK;
m_watch.Start(); m_watch.Start();
} }
@@ -244,10 +244,10 @@ public:
virtual void endTest(CppUnit::Test * WXUNUSED(test)) virtual void endTest(CppUnit::Test * WXUNUSED(test))
{ {
m_watch.Pause(); m_watch.Pause();
wxPrintf(GetResultStr(m_result)); printf("%s", GetResultStr(m_result));
if (m_timing) if (m_timing)
wxPrintf(" %6ld ms", m_watch.Time()); printf(" %6ld ms", m_watch.Time());
wxPrintf("\n"); printf("\n");
} }
protected : protected :
@@ -259,7 +259,7 @@ protected :
RESULT_MAX RESULT_MAX
}; };
wxString GetResultStr(ResultType type) const const char* GetResultStr(ResultType type) const
{ {
static const char *resultTypeNames[] = static const char *resultTypeNames[] =
{ {