added wxString::[w]char_str() to 2.8 for forward compatibility with wx3

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-04-02 12:25:40 +00:00
parent 3646999e0c
commit 89b6915f14
6 changed files with 93 additions and 3 deletions

View File

@@ -53,6 +53,7 @@ private:
#endif // wxLongLong_t
CPPUNIT_TEST( ToDouble );
CPPUNIT_TEST( WriteBuf );
CPPUNIT_TEST( CharStr );
CPPUNIT_TEST_SUITE_END();
void String();
@@ -76,6 +77,7 @@ private:
#endif // wxLongLong_t
void ToDouble();
void WriteBuf();
void CharStr();
DECLARE_NO_COPY_CLASS(StringTestCase)
};
@@ -630,3 +632,15 @@ void StringTestCase::WriteBuf()
}
}
static bool IsFoo(/* non-const */ char *s)
{
return strcmp(s, "foo") == 0;
}
void StringTestCase::CharStr()
{
wxString s(_T("foo"));
CPPUNIT_ASSERT( IsFoo(s.char_str()) );
}