From a88ab55693b1fc79c7a10297f4244608f105eb31 Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Mon, 3 Apr 2023 17:22:43 -0700 Subject: [PATCH] Use get_type_hash_func for typesupports Signed-off-by: Emerson Knapp --- rcl/test/rcl/test_type_hash.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rcl/test/rcl/test_type_hash.cpp b/rcl/test/rcl/test_type_hash.cpp index f9b4df78c..58f19f76c 100644 --- a/rcl/test/rcl/test_type_hash.cpp +++ b/rcl/test/rcl/test_type_hash.cpp @@ -21,6 +21,7 @@ #include "type_description_interfaces/msg/type_description.h" #include "type_description_interfaces/msg/individual_type_description.h" #include "type_description_interfaces/msg/field.h" +#include "type_description_interfaces/msg/field_type.h" #include "rosidl_runtime_c/string_functions.h" #include "rcl/allocator.h" #include "rcl/type_hash.h" @@ -97,11 +98,12 @@ TEST(TestTypeVersionHash, field_type_from_install) { } // NOTE: testing this against the actual installed one, forces an up to date test - auto validation_hash = type_description_interfaces__msg__FieldType__TYPE_HASH; + const rosidl_type_hash_t * validation_hash = + type_description_interfaces__msg__FieldType__get_type_hash(NULL); ASSERT_EQ(direct_hash.version, hash_from_repr.version); - ASSERT_EQ(direct_hash.version, validation_hash.version); + ASSERT_EQ(direct_hash.version, validation_hash->version); ASSERT_EQ(0, memcmp(direct_hash.value, hash_from_repr.value, ROSIDL_TYPE_HASH_SIZE)); - ASSERT_EQ(0, memcmp(direct_hash.value, validation_hash.value, ROSIDL_TYPE_HASH_SIZE)); + ASSERT_EQ(0, memcmp(direct_hash.value, validation_hash->value, ROSIDL_TYPE_HASH_SIZE)); }