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
Original file line number Diff line number Diff line change
Expand Up @@ -2617,7 +2617,7 @@ ReturnCode_t TypeObjectRegistry::set_annotation_parameter_value(
TypeValueConverter::sto(value) : 0));
break;
case TK_CHAR8:
param_value = TypeObjectUtils::build_annotation_parameter_value(!value.empty() ? value : 0);
param_value = TypeObjectUtils::build_annotation_parameter_value(!value.empty() ? value[0] : '\0');
break;
case TK_ENUM:
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ struct TypeRegistryEntry

// Class which holds the TypeObject registry, including every TypeIdentifier (plain and non-plain types), every
// non-plain TypeObject and the non-plain TypeObject serialized sizes.
class TypeObjectRegistry : public ITypeObjectRegistry
// Exported so shared-library test targets can instantiate thin helper subclasses on Windows.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4251)
#endif // _MSC_VER
class FASTDDS_EXPORTED_API TypeObjectRegistry : public ITypeObjectRegistry
{

public:
Expand Down Expand Up @@ -1118,6 +1123,9 @@ class TypeObjectRegistry : public ITypeObjectRegistry
std::mutex type_object_registry_mutex_;

};
#ifdef _MSC_VER
#pragma warning(pop)
#endif // _MSC_VER

} // namespace xtypes
} // namespace dds
Expand Down
17 changes: 9 additions & 8 deletions src/cpp/utils/collections/FixedSizeQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class FixedSizeQueue
public:

using allocator_type = _Alloc;
using allocator_traits = std::allocator_traits<allocator_type>;
using value_type = _Ty;
using pointer = _Ty*;
using const_pointer = const _Ty*;
Expand Down Expand Up @@ -346,7 +347,7 @@ class FixedSizeQueue
return false;
}
--head_;
allocator_.construct(&(*head_), val);
allocator_traits::construct(allocator_, &(*head_), val);
++size_;
return true;
}
Expand Down Expand Up @@ -386,7 +387,7 @@ class FixedSizeQueue
return false;
}
--head_;
allocator_.construct(&(*head_), std::forward<Args &&>(args)...);
allocator_traits::construct(allocator_, &(*head_), std::forward<Args &&>(args)...);
++size_;
return true;
}
Expand All @@ -406,7 +407,7 @@ class FixedSizeQueue
{
return false;
}
allocator_.construct(&(*tail_), val);
allocator_traits::construct(allocator_, &(*tail_), val);
++tail_;
++size_;
return true;
Expand Down Expand Up @@ -446,7 +447,7 @@ class FixedSizeQueue
{
return false;
}
allocator_.construct(&(*tail_), std::forward<Args &&>(args)...);
allocator_traits::construct(allocator_, &(*tail_), std::forward<Args &&>(args)...);
++tail_;
++size_;
return true;
Expand All @@ -464,7 +465,7 @@ class FixedSizeQueue
{
return false;
}
allocator_.destroy(&(*head_));
allocator_traits::destroy(allocator_, &(*head_));
++head_;
--size_;
return true;
Expand All @@ -483,7 +484,7 @@ class FixedSizeQueue
return false;
}
--tail_;
allocator_.destroy(&(*tail_));
allocator_traits::destroy(allocator_, &(*tail_));
--size_;
return true;
}
Expand Down Expand Up @@ -652,7 +653,7 @@ class FixedSizeQueue
++head_;
memmove(&(*head_), &(*old_head), (pos - old_head) * sizeof(value_type));

allocator_.destroy(&(*old_head));
allocator_traits::destroy(allocator_, &(*old_head));
--size_;
iterator next = pos;
return ++next;
Expand All @@ -664,7 +665,7 @@ class FixedSizeQueue
memmove(&(*pos), &(*next), (tail_ - pos) * sizeof(value_type));

--tail_;
allocator_.destroy(&(*tail_));
allocator_traits::destroy(allocator_, &(*tail_));
--size_;
return pos;
}
Expand Down
17 changes: 9 additions & 8 deletions test/blackbox/common/BlackboxTestsTransportTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ TEST_P(TransportTCP, send_resource_cleanup)
}
return tcp_send_resources;
};
EXPECT_EQ(tcp_send_resources(send_resource_list), 1);
EXPECT_EQ(tcp_send_resources(send_resource_list), 1u);

// Release TCP client resources.
client.reset();
Expand All @@ -519,7 +519,7 @@ TEST_P(TransportTCP, send_resource_cleanup)
// Check that the send_resource_list has size 0. This means that the send resource
// for the client has been removed.
send_resource_list = server_chaining_transport->get_send_resource_list();
EXPECT_EQ(tcp_send_resources(send_resource_list), 0);
EXPECT_EQ(tcp_send_resources(send_resource_list), 0u);
send_resource_list.clear();
}

Expand Down Expand Up @@ -642,7 +642,7 @@ TEST_P(TransportTCP, send_resource_cleanup_initial_peer)
}
return tcp_send_resources;
};
EXPECT_EQ(tcp_send_resources(send_resource_list), 1);
EXPECT_EQ(tcp_send_resources(send_resource_list), 1u);

// Release TCP client resources.
server.reset();
Expand All @@ -663,7 +663,7 @@ TEST_P(TransportTCP, send_resource_cleanup_initial_peer)
// Check that the send_resource_list has size 1. This means that the send resource
// for the first client hasn't been removed because it was created from an initial_peer.
send_resource_list = client_chaining_transport->get_send_resource_list();
EXPECT_EQ(tcp_send_resources(send_resource_list), 1);
EXPECT_EQ(tcp_send_resources(send_resource_list), 1u);
send_resource_list.clear();

// If relaunching the server, the client should connect again.
Expand Down Expand Up @@ -1090,8 +1090,8 @@ TEST_P(TransportTCP, tcp_unique_network_flows_init)

EXPECT_TRUE(locators == locators2);
// LocatorList size depends on the number of interfaces. Different address but same port.
ASSERT_GT(locators.size(), 0);
ASSERT_GT(locators2.size(), 0);
ASSERT_GT(locators.size(), 0u);
ASSERT_GT(locators2.size(), 0u);
auto locator1 = locators.begin();
auto locator2 = locators2.begin();
EXPECT_EQ(IPLocator::getPhysicalPort(*locator1), IPLocator::getPhysicalPort(*locator2));
Expand Down Expand Up @@ -1120,8 +1120,8 @@ TEST_P(TransportTCP, tcp_unique_network_flows_init)

EXPECT_FALSE(locators == locators2);
// LocatorList size depends on the number of interfaces. Different address but same port.
ASSERT_GT(locators.size(), 0);
ASSERT_GT(locators2.size(), 0);
ASSERT_GT(locators.size(), 0u);
ASSERT_GT(locators2.size(), 0u);
auto locator1 = locators.begin();
auto locator2 = locators2.begin();
EXPECT_EQ(IPLocator::getPhysicalPort(*locator1), IPLocator::getPhysicalPort(*locator2));
Expand Down Expand Up @@ -1300,3 +1300,4 @@ GTEST_INSTANTIATE_TEST_MACRO(TransportTCP,
}

});

5 changes: 3 additions & 2 deletions test/blackbox/common/DDSBlackboxTestsContentFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class DDSContentFilter : public testing::TestWithParam<communication_type>
// Ensure writer is in clean state
drop_data_on_all_readers();
EXPECT_TRUE(writer.waitForAllAcked(std::chrono::seconds(5)));
EXPECT_EQ(reader->get_unread_count(), 0);
EXPECT_EQ(reader->get_unread_count(), 0ull);

// Send 10 samples with index 1 to 10
auto data = default_helloworld_data_generator();
Expand Down Expand Up @@ -371,7 +371,7 @@ class DDSContentFilter : public testing::TestWithParam<communication_type>
ReturnCode_t expected_ret;
expected_ret = expected_samples == 0 ? RETCODE_NO_DATA : RETCODE_OK;
EXPECT_EQ(expected_ret, reader->take(recv_data, recv_info));
EXPECT_EQ(recv_data.length(), expected_samples);
EXPECT_EQ(static_cast<uint64_t>(recv_data.length()), expected_samples);
for (HelloWorldSeq::size_type i = 0;
i < recv_data.length() && static_cast<uint32_t>(i) < expected_samples;
++i)
Expand Down Expand Up @@ -1282,3 +1282,4 @@ GTEST_INSTANTIATE_TEST_MACRO(DDSContentFilter,
} // namespace dds
} // namespace fastdds
} // namespace eprosima

Loading
Loading