Skip to content

Commit

Permalink
Fixing the code for handling failed bool test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AyanRoy16 committed Oct 2, 2023
1 parent 60197c8 commit 3de3221
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libraries/JANA/Services/JParameterManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ inline void JParameterManager::Parse(const std::string& value, std::string& out)
template <>
inline void JParameterManager::Parse(const std::string& value, bool& val) {
if (value == "0" || value =="false" || value == "off") val = false;
if (value == "1" || value == "true" || value == "on") val = true;
throw JException("'%s' not parseable as bool", value.c_str());
else if (value == "1" || value == "true" || value == "on") val = true;
else throw JException("'%s' not parseable as bool", value.c_str());
}

// @brief Template to parse a string and return in an array
Expand Down

0 comments on commit 3de3221

Please sign in to comment.