From 3aa16badf91cc81563f39ba1f69c52b1c64b9f33 Mon Sep 17 00:00:00 2001 From: tempate Date: Thu, 7 Sep 2023 16:15:47 +0200 Subject: [PATCH] Three small patches to pass the tests Signed-off-by: tempate --- ddspipe_core/src/cpp/communication/dds/DdsBridge.cpp | 5 +++++ ddspipe_core/src/cpp/core/DdsPipe.cpp | 6 ++---- ddspipe_core/src/cpp/testing/random_values.cpp | 7 ++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ddspipe_core/src/cpp/communication/dds/DdsBridge.cpp b/ddspipe_core/src/cpp/communication/dds/DdsBridge.cpp index 8ec0d35b..18ca0c4d 100644 --- a/ddspipe_core/src/cpp/communication/dds/DdsBridge.cpp +++ b/ddspipe_core/src/cpp/communication/dds/DdsBridge.cpp @@ -259,6 +259,11 @@ void DdsBridge::add_writers_to_tracks_( std::move(writers_of_reader), payload_pool_, thread_pool_); + + if (enabled_) + { + tracks_[id]->enable(); + } } } } diff --git a/ddspipe_core/src/cpp/core/DdsPipe.cpp b/ddspipe_core/src/cpp/core/DdsPipe.cpp index d240541c..0547fc43 100644 --- a/ddspipe_core/src/cpp/core/DdsPipe.cpp +++ b/ddspipe_core/src/cpp/core/DdsPipe.cpp @@ -321,10 +321,8 @@ void DdsPipe::removed_endpoint_nts_( if (it_bridge == bridges_.end()) { - // The bridge does not exist. Error. - logError(DDSPIPE, - "Error finding Bridge for topic " << topic << - ". The Bridge does not exist."); + // The bridge does not exist. We cannot remove the writer. Exit. + return; } else if (dynamic_tracks_) { diff --git a/ddspipe_core/src/cpp/testing/random_values.cpp b/ddspipe_core/src/cpp/testing/random_values.cpp index 13d8d35e..27001f9e 100644 --- a/ddspipe_core/src/cpp/testing/random_values.cpp +++ b/ddspipe_core/src/cpp/testing/random_values.cpp @@ -91,11 +91,16 @@ Endpoint random_endpoint( unsigned int seed /* = 0 */) { Endpoint endpoint; + endpoint.active = (seed % 2); endpoint.guid = random_guid(seed); - endpoint.discoverer_participant_id = random_participant_id(seed); endpoint.kind = random_endpoint_kind(seed); endpoint.topic = random_dds_topic(seed); + + // The discoverer participant id cannot be random. + // It must belong to an actual participant or be an empty string. + endpoint.discoverer_participant_id = ""; + return endpoint; }