Unverified Commit 620817ac authored by fmeisel's avatar fmeisel Committed by GitHub

Update yaml_utils.cpp

# fix fme 2021-04-29 - sd=000000  leads to an error because check is just < or >, not <= or >
parent 6df172f3
...@@ -47,7 +47,7 @@ int GetInt32(const YAML::Node &node, const std::string &name) ...@@ -47,7 +47,7 @@ int GetInt32(const YAML::Node &node, const std::string &name)
int GetInt32(const YAML::Node &node, const std::string &name, std::optional<int> minValue, std::optional<int> maxValue) int GetInt32(const YAML::Node &node, const std::string &name, std::optional<int> minValue, std::optional<int> maxValue)
{ {
int value = GetInt32(node, name); int value = GetInt32(node, name);
if (minValue.has_value() && value < minValue) if (minValue.has_value() && value <= minValue)
FieldError(name, "is too small"); FieldError(name, "is too small");
if (maxValue.has_value() && value > maxValue) if (maxValue.has_value() && value > maxValue)
FieldError(name, "is too big"); FieldError(name, "is too big");
...@@ -120,7 +120,7 @@ int64_t GetInt64(const YAML::Node &node, const std::string &name, std::optional< ...@@ -120,7 +120,7 @@ int64_t GetInt64(const YAML::Node &node, const std::string &name, std::optional<
std::optional<int64_t> maxValue) std::optional<int64_t> maxValue)
{ {
int64_t value = GetInt64(node, name); int64_t value = GetInt64(node, name);
if (minValue.has_value() && value < minValue) if (minValue.has_value() && value <= minValue)
FieldError(name, "is too small"); FieldError(name, "is too small");
if (maxValue.has_value() && value > maxValue) if (maxValue.has_value() && value > maxValue)
FieldError(name, "is too big"); FieldError(name, "is too big");
...@@ -171,4 +171,4 @@ std::vector<YAML::Node> GetSequence(const YAML::Node &node, const std::string &n ...@@ -171,4 +171,4 @@ std::vector<YAML::Node> GetSequence(const YAML::Node &node, const std::string &n
return res; return res;
} }
} // namespace yaml } // namespace yaml
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment