make the default value of numeric parameter 0, not 1, to make testing for it more natural; also allow passing string parameter to the benchmarks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-10-13 22:25:51 +00:00
parent 7c14fc8cca
commit ebfa7ceaa4
3 changed files with 51 additions and 7 deletions

View File

@@ -48,7 +48,11 @@ const wxString& GetTestAsciiString()
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);
}
@@ -318,7 +322,11 @@ BENCHMARK_FUNC(ParseHTML)
// 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;
}