From 30079ad0e6a59d824a69de3faf038f3f3f6c9b39 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 May 2020 02:15:52 +0200 Subject: [PATCH] Fix building GUI tests with MSVC This was broken by da48b9e45d (adding an iOS build to travis (#1847), 2020-05-08), as we can't use preprocessor directives inside macro arguments with MSVC (at least with its traditional preprocessor). Use a helper macro to make this work again. --- tests/controls/dialogtest.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/controls/dialogtest.cpp b/tests/controls/dialogtest.cpp index d9bc559e5d..e0b73e5de2 100644 --- a/tests/controls/dialogtest.cpp +++ b/tests/controls/dialogtest.cpp @@ -59,13 +59,18 @@ void ModalDialogsTestCase::MessageDialog() { int rc; +#if wxUSE_FILEDLG + #define FILE_DIALOG_TEST ,\ + wxExpectModal(wxGetCwd() + "/test.txt").Optional() +#else + #define FILE_DIALOG_TEST +#endif + wxTEST_DIALOG ( rc = wxMessageBox("Should I fail?", "Question", wxYES|wxNO), wxExpectModal(wxNO) -#if wxUSE_FILEDLG - ,wxExpectModal(wxGetCwd() + "/test.txt").Optional() -#endif + FILE_DIALOG_TEST ); CPPUNIT_ASSERT_EQUAL(wxNO, rc);