added another Replace() test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-07-30 15:25:19 +00:00
parent fa61b1df36
commit 543cf9ba1a

View File

@ -226,7 +226,7 @@ BENCHMARK_FUNC(ForStringRIter)
// wxString::Replace()
// ----------------------------------------------------------------------------
const size_t REPLACE_STR_LEN = 1000;
const size_t REPLACE_STR_LEN = strlen(asciistr);
BENCHMARK_FUNC(ReplaceLoop)
{
@ -240,19 +240,21 @@ BENCHMARK_FUNC(ReplaceLoop)
return str.length() != 0;
}
BENCHMARK_FUNC(ReplaceMiss)
BENCHMARK_FUNC(ReplaceNone)
{
wxString str('x', REPLACE_STR_LEN);
str.Replace("a", "z");
return str.length() != 0;
return str.Replace("a", "z") == 0;
}
BENCHMARK_FUNC(ReplaceHit)
BENCHMARK_FUNC(ReplaceSome)
{
wxString str(asciistr);
return str.Replace("7", "8") != 0;
}
BENCHMARK_FUNC(ReplaceAll)
{
wxString str('x', REPLACE_STR_LEN);
str.Replace("x", "y");
return str.length() != 0;
return str.Replace("x", "y") != 0;
}