+
+#if WXWIN_COMPATIBILITY_2_8
+
+void LogTestCase::CompatLogger()
+{
+ CompatTestLog log;
+ wxLog * const logOld = wxLog::SetActiveTarget(&log);
+ wxON_BLOCK_EXIT1( wxLog::SetActiveTarget, logOld );
+
+ wxLogError("Old error");
+ CPPUNIT_ASSERT_EQUAL( "Old error", log.GetLog(wxLOG_Error) );
+}
+
+void LogTestCase::CompatLogger2()
+{
+ CompatTestLog2 log;
+ wxLog * const logOld = wxLog::SetActiveTarget(&log);
+ wxON_BLOCK_EXIT1( wxLog::SetActiveTarget, logOld );
+
+ wxLogWarning("Old warning");
+ CPPUNIT_ASSERT_EQUAL( "Old warning", log.Get() );
+}
+
+#endif // WXWIN_COMPATIBILITY_2_8
+
+void LogTestCase::SysError()
+{
+ wxString s;
+ wxLogSysError("Success");
+ CPPUNIT_ASSERT( m_log->GetLog(wxLOG_Error).StartsWith("Success (", &s) );
+ CPPUNIT_ASSERT( s.StartsWith("error 0") );
+
+ wxLogSysError(17, "Error");
+ CPPUNIT_ASSERT( m_log->GetLog(wxLOG_Error).StartsWith("Error (", &s) );
+ CPPUNIT_ASSERT( s.StartsWith("error 17") );
+
+ wxOpen("no-such-file", 0, 0);
+ wxLogSysError("Not found");
+ CPPUNIT_ASSERT( m_log->GetLog(wxLOG_Error).StartsWith("Not found (", &s) );
+ WX_ASSERT_MESSAGE( ("Error message is \"(%s\"", s), s.StartsWith("error 2") );
+}
+