diff --git a/benchmark/run b/benchmark/run index f91853995..00285b2ba 100755 --- a/benchmark/run +++ b/benchmark/run @@ -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 diff --git a/benchmark/test_getline.cpp b/benchmark/test_getline.cpp index c4c609a61..f5709647c 100644 --- a/benchmark/test_getline.cpp +++ b/benchmark/test_getline.cpp @@ -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 line_data = params.get("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 line_data = params.get("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