CPPUNIT_ASSERT_EQUAL( ',', *wxStrpbrk(strWX.c_str(), s.mb_str()) );
CPPUNIT_ASSERT_EQUAL( L',', *wxStrpbrk(strWX.c_str(), s.wc_str()) );
- CPPUNIT_ASSERT_EQUAL( (char *)NULL, wxStrpbrk(strWX, "xyz") );
- CPPUNIT_ASSERT_EQUAL( (wchar_t *)NULL, wxStrpbrk(strWX.c_str(), L"xyz") );
+ CPPUNIT_ASSERT( !wxStrpbrk(strWX, "xyz") );
+ CPPUNIT_ASSERT( !wxStrpbrk(strWX.c_str(), L"xyz") );
}
void CrtTestCase::Strnlen()
{
- // the following calls should not segfault/crash because when passing 0
- // as maxlen, no bytes at all should be read from the given buffer
- // (which is NULL in this case!)
- CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrnlen((const char*)NULL, 0) );
- CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrnlen((const wchar_t*)NULL, 0) );
-
// other misc tests for wxStrnlen(const char*, size_t)
CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrnlen("", 0) );