Remove usage of CHECK_NOTNULL
We want to switch to absl logging instead of glog. gtest and ceres are
going there, and we already have absl as a dependency. ABSL doesn't
have CHECK_NOTNULL, and we can move things over in an easier to review
fashion.
Change-Id: Ifd9a11ec34a2357cec43f88dba015db9c28ed2cf
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/starter_rpc_lib.cc b/aos/starter/starter_rpc_lib.cc
index 230e1b1..b497792 100644
--- a/aos/starter/starter_rpc_lib.cc
+++ b/aos/starter/starter_rpc_lib.cc
@@ -155,9 +155,9 @@
if (is_multi_node) {
node_offsets.push_back(builder.fbb()->CreateString(node_name));
}
- const ApplicationStatus *last_status =
- CHECK_NOTNULL(FindApplicationStatus(*status_fetchers_[node_name],
- command.application));
+ const ApplicationStatus *last_status = FindApplicationStatus(
+ *status_fetchers_[node_name], command.application);
+ CHECK(last_status != nullptr);
current_commands_[node_name].push_back(CommandStatus{
.expected_state = ExpectedStateForCommand(command.command),
.application = std::string(command.application),
@@ -207,7 +207,8 @@
const Status &status = *status_fetchers_[pair.first];
for (const auto &command : pair.second) {
const ApplicationStatus *application_status =
- CHECK_NOTNULL(FindApplicationStatus(status, command.application));
+ FindApplicationStatus(status, command.application);
+ CHECK(application_status != nullptr);
if (application_status->state() == command.expected_state) {
if (command.expected_state == State::RUNNING &&
application_status->id() == command.old_id) {
diff --git a/aos/starter/starterd_lib.cc b/aos/starter/starterd_lib.cc
index 6917bb5..79e564e 100644
--- a/aos/starter/starterd_lib.cc
+++ b/aos/starter/starterd_lib.cc
@@ -321,7 +321,7 @@
}
void Starter::AddChannel(const aos::Channel *channel) {
- CHECK_NOTNULL(channel);
+ CHECK(channel != nullptr);
std::unique_ptr<aos::ipc_lib::MemoryMappedQueue> queue =
std::make_unique<aos::ipc_lib::MemoryMappedQueue>(
shm_base_, FLAGS_permissions, event_loop_.configuration(), channel);
diff --git a/aos/starter/subprocess.cc b/aos/starter/subprocess.cc
index 60f6b92..c36d59b 100644
--- a/aos/starter/subprocess.cc
+++ b/aos/starter/subprocess.cc
@@ -637,7 +637,7 @@
util::Top *top) {
UpdateFileState();
- CHECK_NOTNULL(builder);
+ CHECK(builder != nullptr);
auto name_fbs = builder->CreateString(name_);
const bool valid_pid = pid_ > 0 && status_ != aos::starter::State::STOPPED;