default values for getline bench + hook up in script - refs #3101

This commit is contained in:
Dane Springmeyer 2015-10-01 15:08:49 -07:00
parent 3932cc51b3
commit da054c84e6
2 changed files with 9 additions and 9 deletions

View file

@ -9,7 +9,7 @@ function run {
${BASE}/$1 --threads 0 --iterations $3;
${BASE}/$1 --threads $2 --iterations $(expr $3 / $2);
}
run test_getline 30 10000000
#run test_array_allocation 20 100000
#run test_png_encoding1 10 1000
#run test_png_encoding2 10 50

View file

@ -8,14 +8,14 @@ class test : public benchmark::test_case
public:
std::string line_data_;
test(mapnik::parameters const& params)
: test_case(params)
: test_case(params),
line_data_("this is one line\nand this is a second line\nand a third line")
{
boost::optional<std::string> line_data = params.get<std::string>("line");
if (!line_data)
if (line_data)
{
throw std::runtime_error("please provide a --line \"one line\ntwo line\"");
line_data_ = *line_data;
}
line_data_ = *line_data;
}
bool validate() const
@ -56,14 +56,14 @@ class test2 : public benchmark::test_case
public:
std::string line_data_;
test2(mapnik::parameters const& params)
: test_case(params)
: test_case(params),
line_data_("this is one line\nand this is a second line\nand a third line")
{
boost::optional<std::string> line_data = params.get<std::string>("line");
if (!line_data)
if (line_data)
{
throw std::runtime_error("please provide a --line \"one line\ntwo line\"");
line_data_ = *line_data;
}
line_data_ = *line_data;
}
bool validate() const