Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cie_thread_configurator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ if(BUILD_TESTING)
endif()

ament_package()

ament_add_ros_isolated_gtest(test_create_callback_group_id test/test_create_callback_group_id.cpp)
target_link_libraries(test_create_callback_group_id ${PROJECT_NAME})
17 changes: 17 additions & 0 deletions tests/test_create_callback_group_id.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <gtest/gtest.h>
#include <string>
#include <set>

#include "cie_thread_configurator/cie_thread_configurator.hpp"

TEST(CreateCallbackGroupId, DeterministicAndDistinct) {
using ::cie_thread_configurator::create_callback_group_id;
// Exercise the pure string-ID helper with simple inputs.
// Parameter types follow the declaration in the project header.
auto id1 = create_callback_group_id("v1_0", "v1_1");
auto id2 = create_callback_group_id("v1_0", "v1_1");
auto id3 = create_callback_group_id("v2_0", "v2_1");
EXPECT_EQ(id1, id2);
EXPECT_NE(id1, id3);
EXPECT_FALSE(id1.empty());
}