Skip to content

Commit

Permalink
Use get_type_hash_func for typesupports (#1055)
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
  • Loading branch information
emersonknapp authored and achim-k committed Apr 10, 2023
1 parent 3d1ea76 commit 8a77b82
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rcl/test/rcl/test_type_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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));
}


Expand Down

0 comments on commit 8a77b82

Please sign in to comment.