From 4944c44676e94fcd618a51e44537d2d6c94fd468 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Sep 2014 22:07:34 +0000 Subject: [PATCH] Show the message of unexpected message boxes in wxTestingModalHook. This is more informative than showing just the title and we can do it for the message boxes and it's worth handling them specially just because they are so common. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/testing.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/wx/testing.h b/include/wx/testing.h index 9e4335297b..9139e6febd 100644 --- a/include/wx/testing.h +++ b/include/wx/testing.h @@ -288,6 +288,17 @@ protected: // program here. virtual wxString DescribeUnexpectedDialog(wxDialog* dlg) const { + // Message boxes are handled specially here just because they are so + // ubiquitous. + if ( wxMessageDialog *msgdlg = dynamic_cast(dlg) ) + { + return wxString::Format + ( + "A message box \"%s\"", + msgdlg->GetMessage() + ); + } + return wxString::Format ( "A %s with title \"%s\"",