]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/log/logtest.cpp
Improve drawing of the tree item buttons in the generic renderer.
[wxWidgets.git] / tests / log / logtest.cpp
index 4ee9b2b38faa0443bc24a82a56742ea48859cc58..55988504a15714e359023df70e143e8d3570ecdb 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxLog unit test
 // Author:      Vadim Zeitlin
 // Created:     2009-07-07
-// RCS-ID:      $Id$
 // Copyright:   (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -170,6 +169,7 @@ private:
         CPPUNIT_TEST( CompatLogger2 );
 #endif // WXWIN_COMPATIBILITY_2_8
         CPPUNIT_TEST( SysError );
+        CPPUNIT_TEST( NoWarnings );
     CPPUNIT_TEST_SUITE_END();
 
     void Functions();
@@ -183,6 +183,7 @@ private:
     void CompatLogger2();
 #endif // WXWIN_COMPATIBILITY_2_8
     void SysError();
+    void NoWarnings();
 
     TestLog *m_log;
     wxLog *m_logOld;
@@ -363,3 +364,23 @@ void LogTestCase::SysError()
 #endif // __MINGW32__
 }
 
+void LogTestCase::NoWarnings()
+{
+    // Check that "else" branch is [not] taken as expected and that this code
+    // compiles without warnings (which used to not be the case).
+
+    bool b = wxFalse;
+    if ( b )
+        wxLogError("Not logged");
+    else
+        b = !b;
+
+    CPPUNIT_ASSERT( b );
+
+    if ( b )
+        wxLogError("If");
+    else
+        CPPUNIT_FAIL("Should not be taken");
+
+    CPPUNIT_ASSERT_EQUAL( "If", m_log->GetLog(wxLOG_Error) );
+}