diff --git a/rmw/include/rmw/event.h b/rmw/include/rmw/event.h index 707ccca9..944ee87e 100644 --- a/rmw/include/rmw/event.h +++ b/rmw/include/rmw/event.h @@ -32,6 +32,9 @@ extern "C" /// Define publisher/subscription events typedef enum rmw_event_type_e { + // initial value + RMW_EVENT_INVALID, + // subscription events RMW_EVENT_LIVELINESS_CHANGED, RMW_EVENT_REQUESTED_DEADLINE_MISSED, @@ -48,7 +51,7 @@ typedef enum rmw_event_type_e RMW_EVENT_PUBLICATION_MATCHED, // sentinel value - RMW_EVENT_INVALID + RMW_EVENT_TYPE_MAX } rmw_event_type_t; /// Encapsulate the RMW event implementation, data, and type. diff --git a/rmw/test/test_event.cpp b/rmw/test/test_event.cpp index 980f5dc1..5ac5c7af 100644 --- a/rmw/test/test_event.cpp +++ b/rmw/test/test_event.cpp @@ -20,7 +20,7 @@ TEST(rmw_event, get_zero_initialized_event) const rmw_event_t actual = rmw_get_zero_initialized_event(); EXPECT_EQ(nullptr, actual.implementation_identifier); EXPECT_EQ(nullptr, actual.data); - EXPECT_EQ(0u, actual.event_type); + EXPECT_EQ(RMW_EVENT_INVALID, actual.event_type); } TEST(rmw_event, event_fini) @@ -36,5 +36,5 @@ TEST(rmw_event, event_fini) EXPECT_EQ(rmw_event_fini(&event), RMW_RET_OK); EXPECT_EQ(nullptr, event.implementation_identifier); EXPECT_EQ(nullptr, event.data); - EXPECT_EQ(0u, event.event_type); + EXPECT_EQ(RMW_EVENT_INVALID, event.event_type); }