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.
This commit is contained in:
Vadim Zeitlin
2020-05-10 02:15:52 +02:00
parent 216c14d346
commit 30079ad0e6

View File

@@ -59,13 +59,18 @@ void ModalDialogsTestCase::MessageDialog()
{
int rc;
#if wxUSE_FILEDLG
#define FILE_DIALOG_TEST ,\
wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt").Optional()
#else
#define FILE_DIALOG_TEST
#endif
wxTEST_DIALOG
(
rc = wxMessageBox("Should I fail?", "Question", wxYES|wxNO),
wxExpectModal<wxMessageDialog>(wxNO)
#if wxUSE_FILEDLG
,wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt").Optional()
#endif
FILE_DIALOG_TEST
);
CPPUNIT_ASSERT_EQUAL(wxNO, rc);