lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6148] Add a unit test verifying that wxLog errors are sho


From: Greg Chicares
Subject: [lmi-commits] [6148] Add a unit test verifying that wxLog errors are shown
Date: Thu, 26 Mar 2015 23:08:15 +0000

Revision: 6148
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6148
Author:   chicares
Date:     2015-03-26 23:08:15 +0000 (Thu, 26 Mar 2015)
Log Message:
-----------
Add a unit test verifying that wxLog errors are shown

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/Makefile.am
    lmi/trunk/objects.make

Added Paths:
-----------
    lmi/trunk/wx_test_log_errors.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2015-03-26 22:57:15 UTC (rev 6147)
+++ lmi/trunk/ChangeLog 2015-03-26 23:08:15 UTC (rev 6148)
@@ -35922,3 +35922,11 @@
 Don't redirect all wxLog messages to stderr, just the debug ones. See:
   http://lists.nongnu.org/archive/html/lmi/2015-03/msg00026.html
 
+20150326T2308Z <address@hidden> [516]
+
+  Makefile.am
+  objects.make
+  wx_test_log_errors.cpp [new file]
+Add a unit test verifying that wxLog errors are shown. See:
+  http://lists.nongnu.org/archive/html/lmi/2015-03/msg00026.html
+

Modified: lmi/trunk/Makefile.am
===================================================================
--- lmi/trunk/Makefile.am       2015-03-26 22:57:15 UTC (rev 6147)
+++ lmi/trunk/Makefile.am       2015-03-26 23:08:15 UTC (rev 6148)
@@ -266,6 +266,7 @@
   wx_test_expiry_dates.cpp \
   wx_test_input_sequences.cpp \
   wx_test_input_validation.cpp \
+  wx_test_log_errors.cpp \
   wx_test_paste_census.cpp \
   wx_test_pdf_create.cpp \
   wx_test_validate_output.cpp

Modified: lmi/trunk/objects.make
===================================================================
--- lmi/trunk/objects.make      2015-03-26 22:57:15 UTC (rev 6147)
+++ lmi/trunk/objects.make      2015-03-26 23:08:15 UTC (rev 6148)
@@ -367,6 +367,7 @@
   wx_test_expiry_dates.o \
   wx_test_input_sequences.o \
   wx_test_input_validation.o \
+  wx_test_log_errors.o \
   wx_test_paste_census.o \
   wx_test_pdf_create.o \
   wx_test_validate_output.o \

Added: lmi/trunk/wx_test_log_errors.cpp
===================================================================
--- lmi/trunk/wx_test_log_errors.cpp                            (rev 0)
+++ lmi/trunk/wx_test_log_errors.cpp    2015-03-26 23:08:15 UTC (rev 6148)
@@ -0,0 +1,52 @@
+// Test that wxLog error messages are shown to the user.
+//
+// Copyright (C) 2015 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+#ifdef __BORLANDC__
+#   include "pchfile.hpp"
+#   pragma hdrstop
+#endif
+
+#include "assert_lmi.hpp"
+#include "wx_test_case.hpp"
+
+#include <wx/docview.h>
+#include <wx/log.h>
+#include <wx/testing.h>
+#include <wx/uiaction.h>
+
+LMI_WX_TEST_CASE(log_error)
+{
+    wxDocManager* const doc_manager = wxDocManager::GetDocumentManager();
+    LMI_ASSERT(doc_manager);
+
+    // Silently opening a file without extension must fail as the doc/view
+    // framework has no way to find the template associated with it.
+    doc_manager->CreateDocument("file_without_extension", wxDOC_SILENT);
+
+    wxTEST_DIALOG
+        (wxLog::FlushActive()
+        ,wxExpectModal<wxMessageDialog>(wxOK).
+            Describe("warning about being unable to determine file format")
+        );
+}
+


Property changes on: lmi/trunk/wx_test_log_errors.cpp
___________________________________________________________________
Added: svn:keywords
   + Id




reply via email to

[Prev in Thread] Current Thread [Next in Thread]