Skip to content

Commit

Permalink
making level numbers explicit
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
  • Loading branch information
ct2034 committed Dec 5, 2023
1 parent f79d570 commit 45b1c5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class GenericAnalyzerBase : public Analyzer

auto header_status = std::make_shared<diagnostic_msgs::msg::DiagnosticStatus>();
header_status->name = path_;
header_status->level = 0;
header_status->level = diagnostic_msgs::msg::DiagnosticStatus::OK;
header_status->message = "OK";

std::vector<std::shared_ptr<diagnostic_msgs::msg::DiagnosticStatus>> processed;
Expand Down Expand Up @@ -239,13 +239,13 @@ class GenericAnalyzerBase : public Analyzer

// If we expect a given number of items, check that we have this number
if (num_items_expected_ == 0 && items_.empty()) {
header_status->level = 0;
header_status->level = diagnostic_msgs::msg::DiagnosticStatus::OK;
header_status->message = "OK";
} else if ( // NOLINT
num_items_expected_ > 0 &&
static_cast<int8_t>(items_.size()) != num_items_expected_)
{ // NOLINT
int8_t lvl = 2;
int8_t lvl = diagnostic_msgs::msg::DiagnosticStatus::ERROR;
header_status->level = std::max(lvl, static_cast<int8_t>(header_status->level));

std::stringstream expec, item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class OtherAnalyzer : public GenericAnalyzerBase
processed.begin();
for (; it != processed.end(); ++it) {
if ((*it)->name == path_) {
(*it)->level = 2;
(*it)->level = diagnostic_msgs::msg::DiagnosticStatus::ERROR;
(*it)->message = "Unanalyzed items found in \"Other\"";
break;
}
Expand Down

0 comments on commit 45b1c5c

Please sign in to comment.