Handle null node in SimulatedEventLoopFactory better
Our tools need to deal with both a world with and without nodes. The
easy way to do that is to allow nullptr as a node in more places to
signal that we are in a single node world.
Change-Id: I6dcbe5c1bd721d6417d30e74b79f861d741970df
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index 4feb401..91190e7 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -70,6 +70,8 @@
// log file.
reader.Register(&log_reader_factory);
+ EXPECT_EQ(log_reader_factory.node(), nullptr);
+
std::unique_ptr<EventLoop> test_event_loop =
log_reader_factory.MakeEventLoop("log_reader");
@@ -207,6 +209,8 @@
}
LogReader reader(logfile);
+ ASSERT_NE(reader.node(), nullptr);
+ EXPECT_EQ(reader.node()->name()->string_view(), "pi1");
// TODO(austin): Also replay as pi2 or pi3 and make sure we see the pong
// messages. This won't work today yet until the log reading code gets