lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5882] Test version shown in title of "about" dialog (VS)


From: Greg Chicares
Subject: [lmi-commits] [5882] Test version shown in title of "about" dialog (VS)
Date: Fri, 14 Mar 2014 13:45:17 +0000

Revision: 5882
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5882
Author:   chicares
Date:     2014-03-14 13:45:17 +0000 (Fri, 14 Mar 2014)
Log Message:
-----------
Test version shown in title of "about" dialog (VS)

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/main_wx_test.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-03-14 13:41:16 UTC (rev 5881)
+++ lmi/trunk/ChangeLog 2014-03-14 13:45:17 UTC (rev 5882)
@@ -33720,3 +33720,21 @@
   wx-3.0.0.patch [new file]
 Upgrade to wx-3.0.0 .
 
+20140313T2143Z <address@hidden> [542]
+
+  wx-3.0.0.patch
+Install 'testing.h' header. See:
+  http://lists.nongnu.org/archive/html/lmi/2014-03/msg00006.html
+
+20140314T1341Z <address@hidden> [542]
+
+  wx-3.0.0.patch
+Suppress an apparently bogus error message. See:
+  http://lists.nongnu.org/archive/html/lmi/2014-03/msg00008.html
+
+20140314T1345Z <address@hidden> [542]
+
+  main_wx_test.cpp
+Test version shown in title of "about" dialog (VS). See:
+  http://lists.nongnu.org/archive/html/lmi/2014-02/msg00008.html
+

Modified: lmi/trunk/main_wx_test.cpp
===================================================================
--- lmi/trunk/main_wx_test.cpp  2014-03-14 13:41:16 UTC (rev 5881)
+++ lmi/trunk/main_wx_test.cpp  2014-03-14 13:45:17 UTC (rev 5882)
@@ -26,13 +26,18 @@
 #   pragma hdrstop
 #endif
 
+#include "assert_lmi.hpp"
 #include "main_common.hpp"              // initialize_application()
 #include "msw_workarounds.hpp"
 #include "path_utility.hpp"             // initialize_filesystem()
 #include "skeleton.hpp"
 #include "test_tools.hpp"
+#include "version.hpp"
 
+#include <wx/dialog.h>
 #include <wx/init.h>                    // wxEntry()
+#include <wx/testing.h>
+#include <wx/uiaction.h>
 
 class SkeletonTest;
 DECLARE_APP(SkeletonTest)
@@ -42,9 +47,36 @@
   public:
     static void test()
         {
+        test_about_dialog_version();
         }
+
+  private:
+    static void test_about_dialog_version();
 };
 
+void application_test::test_about_dialog_version()
+{
+    struct expect_about_dialog : public wxExpectModalBase<wxDialog>
+    {
+        virtual int OnInvoked(wxDialog* d) const
+            {
+            LMI_ASSERT(0 != d);
+            BOOST_TEST(d->GetTitle().EndsWith(LMI_VERSION));
+            return wxID_OK;
+            }
+    };
+
+    wxUIActionSimulator z;
+    z.KeyDown('h', wxMOD_ALT);
+    z.KeyUp  ('h', wxMOD_ALT);
+    z.KeyDown('a'           );
+    z.KeyUp  ('a'           );
+    wxTEST_DIALOG
+        (wxYield()
+        ,expect_about_dialog()
+        );
+}
+
 // Application to drive the tests
 class SkeletonTest : public Skeleton
 {
@@ -65,7 +97,9 @@
 bool SkeletonTest::OnInit()
 {
     if(!Skeleton::OnInit())
+        {
         return false;
+        }
 
     // Run the tests at idle time, when the main loop is running, in order to
     // do it in as realistic conditions as possible.




reply via email to

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