From 481fe98fa377672e8fc1d18e8defc486e1461edf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Jul 2014 11:54:42 +0000 Subject: [PATCH] Ensure that wxCmdLineParser::FoundSwitch() asserts when used wrongly. This makes CmdLine unit test pass with the assertions backported from trunk, where FoundSwitch() does assert when called for a non-switch. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cmdline.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 972d8431da..97e3229637 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -144,7 +144,13 @@ struct wxCmdLineOption bool HasValue() const { return m_hasVal; } void SetNegated() { m_isNegated = true; } - bool IsNegated() const { return m_isNegated; } + bool IsNegated() const + { + wxASSERT_MSG( kind == wxCMD_LINE_SWITCH, + wxT("kind mismatch in wxCmdLineArg") ); + + return m_isNegated; + } // Reset to the initial state, called before parsing another command line. void Reset()