X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa3b08caf17a6310540d623b6ce508c201efb9a5..7256e9b6ad4bc899d7c4d1d70e7afc93965200f1:/tests/regex/regextest.cpp diff --git a/tests/regex/regextest.cpp b/tests/regex/regextest.cpp index 8988557568..042741ed3e 100644 --- a/tests/regex/regextest.cpp +++ b/tests/regex/regextest.cpp @@ -158,7 +158,7 @@ int wxWcscmp(const wchar_t* s1, const wchar_t* s2) if (nLen1 != nLen2) return nLen1 - nLen2; - return wxTmemcmp(s1, s2, nLen1); + return memcmp(s1, s2, nLen1*sizeof(wchar_t)); } // convert a string from UTF8 to the internal encoding @@ -178,8 +178,9 @@ wxString RegExTestCase::Conv(const char *str) // void RegExTestCase::parseFlags(const wxString& flags) { - for (const wxChar *p = flags; *p; p++) { - switch (*p) { + for ( wxString::const_iterator p = flags.begin(); p != flags.end(); ++p ) + { + switch ( (*p).GetValue() ) { // noop case '-': break; @@ -271,19 +272,23 @@ void RegExTestCase::doTest(int flavor) // m - check the match returns the strings given if (m_mode == 'm') + { if (start < INT_MAX) result = m_data.substr(start, len); else result = _T(""); + } // i - check the match returns the offsets given else if (m_mode == 'i') + { if (start > INT_MAX) result = _T("-1 -1"); else if (start + len > 0) result << start << _T(" ") << start + len - 1; else result << start << _T(" -1"); + } msg.clear(); msg << _T("match(") << i << _T(") == ") << quote(result) @@ -323,7 +328,7 @@ wxString RegExTestCase::quote(const wxString& arg) wxString str; for (size_t i = 0; i < arg.length(); i++) { - wxUChar ch = (wxChar)arg[i]; + wxChar ch = (wxChar)arg[i]; const wxChar *p = wxStrchr(needEscape, ch); if (p)