From da054c84e6eb986ca20a6e9e52c2dcbb2740f653 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 1 Oct 2015 15:08:49 -0700 Subject: [PATCH] default values for getline bench + hook up in script - refs #3101 --- benchmark/run | 2 +- benchmark/test_getline.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) 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