[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 22a023e: Test ledger scaling in GUI test
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 22a023e: Test ledger scaling in GUI test |
Date: |
Thu, 22 Mar 2018 20:24:03 -0400 (EDT) |
branch: master
commit 22a023e96d020770c5866ee74123a0d0dd69d2c6
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Test ledger scaling in GUI test
Made an existing test serve two purposes:
(1) as before, test that "File | Print to PDF" creates a PDF file;
(2) in addition, test the ledger scaling code.
One test suffices to cover both purposes.
After the recent upgrade to MinGW-w64 gcc-7.2.0, an assertion failed
whenever a ledger needed scaling--i.e., when a PDF file is created.
This was discovered only by accident; now such an anomaly would be
automatically detected.
---
wx_test_pdf_create.cpp | 37 ++++++++++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 3 deletions(-)
diff --git a/wx_test_pdf_create.cpp b/wx_test_pdf_create.cpp
index 1fe088f..0329330 100644
--- a/wx_test_pdf_create.cpp
+++ b/wx_test_pdf_create.cpp
@@ -58,13 +58,44 @@ std::string fo_suffix(int n)
///
/// Run these commands:
/// File | New | Illustration
+/// [multiply specamt and pmts by 1000]
+/// OK
/// File | Print to PDF
/// and verify that the PDF file was created; then erase it.
LMI_WX_TEST_CASE(pdf_illustration)
{
- // Create a new illustration.
- wx_test_new_illustration ill;
+ struct billion_dollar_illustration
+ :public wxExpectModalBase<MvcController>
+ {
+ int OnInvoked(MvcController* dialog) const override
+ {
+ dialog->Show();
+ wxYield();
+
+ wx_test_focus_controller_child(*dialog, "SpecifiedAmount");
+
+ wxUIActionSimulator ui;
+ ui.Text("1000000000");
+ wxYield();
+
+ wx_test_focus_controller_child(*dialog, "Payment");
+
+ ui.Text("20000000");
+ wxYield();
+
+ return wxID_OK;
+ }
+
+ wxString GetDefaultDescription() const override
+ {
+ return "edit cell dialog to test $1,000,000,000 scaling";
+ }
+ };
+
+ // Create a new billion-dollar illustration.
+ // Double parentheses circumvent the most vexing parse.
+ wx_test_new_illustration ill((billion_dollar_illustration()));
// Ensure that the output file doesn't exist in the first place.
output_pdf_existence_checker output_pdf(get_current_document_name());
@@ -74,7 +105,7 @@ LMI_WX_TEST_CASE(pdf_illustration)
wxYield();
// Close the illustration, we don't need it any more.
- ill.close();
+ ill.close_discard_changes();
// Finally check for the expected output file existence.
LMI_ASSERT(output_pdf.exists());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master 22a023e: Test ledger scaling in GUI test,
Greg Chicares <=