static wxString testString;
if ( testString.empty() )
{
- for ( long n = 0; n < Bench::GetNumericParameter(); n++ )
+ long num = Bench::GetNumericParameter();
+ if ( !num )
+ num = 1;
+
+ for ( long n = 0; n < num; n++ )
testString += wxString::FromAscii(asciistr);
}
return str.Replace("x", "y") != 0;
}
+BENCHMARK_FUNC(ReplaceLonger)
+{
+ wxString str('x', ASCIISTR_LEN);
+ return str.Replace("x", "yy") != 0;
+}
+
+BENCHMARK_FUNC(ReplaceShorter)
+{
+ wxString str('x', ASCIISTR_LEN);
+ return str.Replace("xx", "y") != 0;
+}
+
// ----------------------------------------------------------------------------
// string buffers: wx[W]CharBuffer
// this is going to make for some invalid HTML, of course, but it
// doesn't really matter
- for ( long n = 0; n < Bench::GetNumericParameter(); n++ )
+ long num = Bench::GetNumericParameter();
+ if ( !num )
+ num = 1;
+
+ for ( long n = 0; n < num; n++ )
html += html1;
}