Skip to content

Commit

Permalink
introduce RMW_EVENT_TYPE_MAX in rmw_event_type_t.
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya committed Oct 11, 2024
1 parent 803d399 commit 092cb5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion rmw/include/rmw/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions rmw/test/test_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

0 comments on commit 092cb5c

Please sign in to comment.