From 562d27670af1954edbefb40eaf22a368502bd403 Mon Sep 17 00:00:00 2001 From: sairajat Date: Sun, 12 Feb 2017 16:14:43 -0500 Subject: [PATCH] Fix Tests --- source/base/parameter_handler.cc | 12 ++++++------ .../parameter_handler_3_with_space.output | 7 ++++--- .../prm/parameter_handler_3_with_space.prm | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index 128e2410b3..571df879f7 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -467,11 +467,11 @@ namespace Patterns bool Selection::match (const std::string &test_string) const { std::string tmp(sequence); - // remove whitespace at beginning + +// remove whitespace at beginning while ((tmp.length() != 0) && (std::isspace (tmp[0]))) - tmp.erase (0,1); + tmp.erase (0,1); // check the different possibilities - // check the different possibilities while (tmp.find('|') != std::string::npos) { if (test_string == std::string(tmp, 0, tmp.find('|'))) @@ -480,11 +480,11 @@ namespace Patterns tmp.erase (0, tmp.find('|')+1); }; - //remove whitespace at the end - while ((tmp.length() != 0) && (std::isspace (tmp[*(tmp.end()-1)]))) +//remove whitespace at the end + while ((tmp.length() != 0) && (std::isspace (*(tmp.end()-1)))) tmp.erase (tmp.end()-1); - // check last choice, not finished by | +// check last choice, not finished by | if (test_string == tmp) return true; diff --git a/tests/parameter_handler/parameter_handler_3_with_space.output b/tests/parameter_handler/parameter_handler_3_with_space.output index 9e8b1f79e4..3a1438c373 100644 --- a/tests/parameter_handler/parameter_handler_3_with_space.output +++ b/tests/parameter_handler/parameter_handler_3_with_space.output @@ -3,12 +3,13 @@ # --------------------- subsection Testing # docs 3 - set double = 3.1415926 - set int = 3 # default: 1 + set double = 3.1415926 + set int = 3 # default: 1 # docs 1 set string list1 = a, b, c # default: a - #docs 2 + + # docs 2 set string list2 = h, b, c # default: h end diff --git a/tests/parameter_handler/prm/parameter_handler_3_with_space.prm b/tests/parameter_handler/prm/parameter_handler_3_with_space.prm index b1737805f4..0c31e93478 100644 --- a/tests/parameter_handler/prm/parameter_handler_3_with_space.prm +++ b/tests/parameter_handler/prm/parameter_handler_3_with_space.prm @@ -1,5 +1,5 @@ subsection Testing set string list1 = a, b, c set string list2 = h, b, c - set int = 3 + set int = 3 end -- 2.39.5