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
This commit is contained in:
Vadim Zeitlin
2014-07-14 11:54:42 +00:00
parent 0de26e62a7
commit 481fe98fa3

View File

@@ -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()