X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9e994615409e36d441135e4fa0761cf0398a2aa..ff38d8c1ebb74788dd8c61c88183a31832927347:/tests/regex/wxregextest.cpp diff --git a/tests/regex/wxregextest.cpp b/tests/regex/wxregextest.cpp index fd8f19251f..7d7b3085b9 100644 --- a/tests/regex/wxregextest.cpp +++ b/tests/regex/wxregextest.cpp @@ -7,7 +7,7 @@ // Licence: wxWidgets licence /////////////////////////////////////////////////////////////////////////////// -#include "wx/wxprec.h" +#include "testprec.h" #ifdef __BORLANDC__ # pragma hdrstop @@ -20,12 +20,13 @@ #if wxUSE_REGEX #include "wx/regex.h" -#include "wx/cppunit.h" #include "wx/tokenzr.h" #include -using namespace std; -using namespace CppUnit; +using CppUnit::Test; +using CppUnit::TestCase; +using CppUnit::TestSuite; +using std::string; /////////////////////////////////////////////////////////////////////////////// @@ -113,9 +114,9 @@ void RegExMatchTestCase::runTest() wxString msgstr; msgstr.Printf(_T("\\%d == '%s' (expected '%s')"), (int)i, result.c_str(), expected.c_str()); - const char *msg = msgstr.mb_str(); - CPPUNIT_ASSERT_MESSAGE(msg, result == expected); + CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), + result == expected); } if ((m_flags & wxRE_NOSUB) == 0) @@ -143,7 +144,7 @@ public: m_expected(expected), m_count(count), m_flags(flags) - { } + { } protected: void runTest(); @@ -166,12 +167,10 @@ void RegExReplaceTestCase::runTest() wxString msgstr; msgstr.Printf(_T("returns '%s' (expected '%s')"), text.c_str(), m_expected.c_str()); - const char *msg = msgstr.mb_str(); - CPPUNIT_ASSERT_MESSAGE(msg, text == m_expected); + CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), text == m_expected); msgstr.Printf(_T("matches %d times (expected %d)"), nRepl, m_count); - msg = msgstr.mb_str(); - CPPUNIT_ASSERT_MESSAGE(msg, nRepl == m_count); + CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), nRepl == m_count); }