[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] [PATCH 5/5] Test: About dialog's title should contain version info
From: |
Václav Slavík |
Subject: |
[lmi] [PATCH 5/5] Test: About dialog's title should contain version info. |
Date: |
Tue, 18 Feb 2014 18:15:13 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Finally, this one adds the first test to the GUI suite, testing
the presence of LMI version in About box's title:
Test: About dialog's title should contain version info.
---
main_wx_test.cpp | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index 2478e06..c752470 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -46,8 +46,12 @@
#include "main_common.hpp"
#include "msw_workarounds.hpp"
#include "path_utility.hpp"
+#include "version.hpp"
-#include <wx/defs.h>
+#include <wx/dialog.h>
+#include <wx/menu.h>
+#include <wx/testing.h>
+#include <wx/uiaction.h>
class SkeletonTest;
DECLARE_APP(SkeletonTest)
@@ -57,10 +61,38 @@ class application_test
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 *dlg) const
+ {
+ BOOST_TEST(dlg->GetTitle().EndsWith(LMI_VERSION));
+ return wxID_OK;
+ };
+ };
+
+ wxUIActionSimulator sim;
+ sim.KeyDown('h', wxMOD_ALT);
+ sim.KeyUp('h', wxMOD_ALT);
+ sim.KeyDown('a');
+ sim.KeyUp('a');
+ wxTEST_DIALOG
+ (
+ wxYield(),
+ expect_about_dialog()
+ );
+}
+
+
// Application to drive the tests
class SkeletonTest : public Skeleton
{
--
1.8.5.5
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi] [PATCH 5/5] Test: About dialog's title should contain version info.,
Václav Slavík <=