Skip to content
Closed
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 @@ -474,7 +474,7 @@ score::Result<void> GatewayApplication::RegisterUpdateNotification(impl::Instanc
}

auto& proxy_event = event_it->second;
proxy_event.Subscribe(kGatewaySubscribeSamples);
score::cpp::ignore = proxy_event.Subscribe(kGatewaySubscribeSamples);

using ReceiveCallback = safecpp::MoveOnlyScopedFunction<void()>;
auto scoped_handler = std::make_shared<ReceiveCallback>(
Expand All @@ -483,7 +483,8 @@ score::Result<void> GatewayApplication::RegisterUpdateNotification(impl::Instanc
auto specifier_result = impl::InstanceSpecifier::Create(std::string{spec});
if (specifier_result.has_value())
{
transport_layer_->NotifyUpdate(std::move(specifier_result).value(), elem_type, std::string{elem_name});
score::cpp::ignore = transport_layer_->NotifyUpdate(
std::move(specifier_result).value(), elem_type, std::string{elem_name});
}
});

Expand Down Expand Up @@ -525,7 +526,7 @@ score::Result<void> GatewayApplication::UnregisterUpdateNotification(impl::Insta
return MakeUnexpected(GatewayErrorc::kUnknownServiceElement);
}

event_it->second.UnsetReceiveHandler();
score::cpp::ignore = event_it->second.UnsetReceiveHandler();
event_it->second.Unsubscribe();
return {};
}
Expand Down Expand Up @@ -555,7 +556,7 @@ score::Result<void> GatewayApplication::NotifyUpdate(impl::InstanceSpecifier ser
return MakeUnexpected(GatewayErrorc::kUnknownServiceElement);
}

event_it->second.Notify();
score::cpp::ignore = event_it->second.Notify();
return {};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ TEST(GatewayApplicationSetupTest, SetupWithoutInjectedTransportCallsTransportFac

// When Setup() is called without a pre-injected transport
// Then TransportFactory::Create is invoked and the process terminates
EXPECT_DEATH(app.Setup(), ".*");
EXPECT_DEATH(score::cpp::ignore = app.Setup(), ".*");
}

// ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void BidirectionalTransport::HandleIncomingMessage(std::unique_ptr<TransportMess

if (RequiresResponse(message->GetType()))
{
SendAck(message->GetSequenceNumber());
score::cpp::ignore = SendAck(message->GetSequenceNumber());
}

// Post to dispatch queue rather than calling the handler inline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ void SampleHyperVisorTransport::HandleProvideServiceRequest(std::unique_ptr<Tran
return;
}
PreCreateInterVmSharedMemory(specifier_result.value(), request.GetShmControlSize(), request.GetShmDataSize());
gateway_app_.ProvideService(specifier_result.value(), request.GetServiceElements());
const auto result = gateway_app_.ProvideService(specifier_result.value(), request.GetServiceElements());
if (!result.has_value())
{
log::LogError("LoLa") << "SampleTransport: ProvideService failed!";
}
}

void SampleHyperVisorTransport::HandleStopOfferServiceRequest(std::unique_ptr<TransportMessage> message)
Expand All @@ -166,7 +170,11 @@ void SampleHyperVisorTransport::HandleOfferServiceRequest(std::unique_ptr<Transp
log::LogError("LoLa") << "SampleTransport: Invalid instance specifier in OfferServiceRequest!";
return;
}
gateway_app_.OfferService(specifier_result.value());
const auto result = gateway_app_.OfferService(specifier_result.value());
if (!result.has_value())
{
log::LogError("LoLa") << "SampleTransport: OfferService failed!";
}
}

void SampleHyperVisorTransport::HandleUpdateNotification(std::unique_ptr<TransportMessage> message)
Expand All @@ -178,7 +186,12 @@ void SampleHyperVisorTransport::HandleUpdateNotification(std::unique_ptr<Transpo
log::LogError("LoLa") << "SampleTransport: Invalid instance specifier in UpdateNotification!";
return;
}
gateway_app_.NotifyUpdate(specifier_result.value(), notification.GetElementType(), notification.GetElementName());
const auto result = gateway_app_.NotifyUpdate(
specifier_result.value(), notification.GetElementType(), notification.GetElementName());
if (!result.has_value())
{
log::LogError("LoLa") << "SampleTransport: NotifyUpdate failed!";
}
}

void SampleHyperVisorTransport::HandleRegisterNotificationRequest(std::unique_ptr<TransportMessage> message)
Expand All @@ -190,8 +203,12 @@ void SampleHyperVisorTransport::HandleRegisterNotificationRequest(std::unique_pt
log::LogError("LoLa") << "SampleTransport: Invalid instance specifier in RegisterNotificationRequest!";
return;
}
gateway_app_.RegisterUpdateNotification(
const auto result = gateway_app_.RegisterUpdateNotification(
specifier_result.value(), request.GetElementType(), request.GetElementName());
if (!result.has_value())
{
log::LogError("LoLa") << "SampleTransport: RegisterUpdateNotification failed!";
}
}

void SampleHyperVisorTransport::HandleUnregisterNotificationRequest(std::unique_ptr<TransportMessage> message)
Expand All @@ -203,8 +220,12 @@ void SampleHyperVisorTransport::HandleUnregisterNotificationRequest(std::unique_
log::LogError("LoLa") << "SampleTransport: Invalid instance specifier in UnregisterNotificationRequest!";
return;
}
gateway_app_.UnregisterUpdateNotification(
const auto result = gateway_app_.UnregisterUpdateNotification(
specifier_result.value(), request.GetElementType(), request.GetElementName());
if (!result.has_value())
{
log::LogError("LoLa") << "SampleTransport: UnregisterUpdateNotification failed!";
}
}

void SampleHyperVisorTransport::Shutdown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ TEST_F(SampleHyperVisorTransportTest, OfferServiceRequestWithCorrectType)
SendRequest(::testing::Property(&TransportMessage::GetType, MessageType::kOfferServiceRequest)))
.WillOnce(::testing::Return(score::Result<void>{}));
// when calling OfferService on SampleHyperVisorTransport
transport_->OfferService(specifier);
score::cpp::ignore = transport_->OfferService(specifier);
}

TEST_F(SampleHyperVisorTransportTest, StopOfferServiceRequestWithCorrectType)
Expand All @@ -216,7 +216,7 @@ TEST_F(SampleHyperVisorTransportTest, StopOfferServiceRequestWithCorrectType)
SendRequest(::testing::Property(&TransportMessage::GetType, MessageType::kStopOfferServiceRequest)))
.WillOnce(::testing::Return(score::Result<void>{}));
// when calling StopOfferService on SampleHyperVisorTransport
transport_->StopOfferService(specifier);
score::cpp::ignore = transport_->StopOfferService(specifier);
}

TEST_F(SampleHyperVisorTransportTest, NotifyUpdateWithCorrectType)
Expand All @@ -230,7 +230,7 @@ TEST_F(SampleHyperVisorTransportTest, NotifyUpdateWithCorrectType)
SendNotification(::testing::Property(&TransportMessage::GetType, MessageType::kUpdateNotification)))
.WillOnce(::testing::Return(score::Result<void>{}));
// when calling NotifyUpdate on SampleHyperVisorTransport
transport_->NotifyUpdate(specifier, impl::ServiceElementType::EVENT, "SpeedEvent");
score::cpp::ignore = transport_->NotifyUpdate(specifier, impl::ServiceElementType::EVENT, "SpeedEvent");
}

TEST_F(SampleHyperVisorTransportTest, RegisterUpdateNotificationWithCorrectType)
Expand All @@ -244,7 +244,8 @@ TEST_F(SampleHyperVisorTransportTest, RegisterUpdateNotificationWithCorrectType)
SendRequest(::testing::Property(&TransportMessage::GetType, MessageType::kRegisterNotificationRequest)))
.WillOnce(::testing::Return(score::Result<void>{}));
// when calling RegisterUpdateNotification on SampleHyperVisorTransport
transport_->RegisterUpdateNotification(specifier, impl::ServiceElementType::EVENT, "SpeedEvent");
score::cpp::ignore =
transport_->RegisterUpdateNotification(specifier, impl::ServiceElementType::EVENT, "SpeedEvent");
}

TEST_F(SampleHyperVisorTransportTest, UnregisterUpdateNotificationWithCorrectType)
Expand All @@ -259,7 +260,8 @@ TEST_F(SampleHyperVisorTransportTest, UnregisterUpdateNotificationWithCorrectTyp
SendRequest(::testing::Property(&TransportMessage::GetType, MessageType::kUnregisterNotificationRequest)))
.WillOnce(::testing::Return(score::Result<void>{}));
// when calling UnregisterUpdateNotification on SampleHyperVisorTransport
transport_->UnregisterUpdateNotification(specifier, impl::ServiceElementType::EVENT, "SpeedEvent");
score::cpp::ignore =
transport_->UnregisterUpdateNotification(specifier, impl::ServiceElementType::EVENT, "SpeedEvent");
}

TEST_F(SampleHyperVisorTransportTest, ResolveShmPathReturnsEmptyObjectIfSpecifierCanNotBeResolved)
Expand Down Expand Up @@ -622,7 +624,9 @@ TEST_F(SampleHyperVisorTransportTest, ProvideServiceDeathTest)
// When calling ProvideService with a valid instance specifier, then it is expected to terminate.
// TODO This test needs to be adapted when implementing ResolveShmPaths() and GetShmSizes() based on the actual
// HyperVisor SHM technology.
EXPECT_DEATH(transport_->ProvideService(CreateValidInstanceSpecifier(), std::vector<impl::EventInfo>{}), ".*");
EXPECT_DEATH(
score::cpp::ignore = transport_->ProvideService(CreateValidInstanceSpecifier(), std::vector<impl::EventInfo>{}),
".*");
}

} // namespace
Expand Down
14 changes: 7 additions & 7 deletions score/mw/com/impl/bindings/lola/proxy_event_common_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ TYPED_TEST(LolaProxyEventCommonFixture, RegisterSubscriptionStateChangeHandler)
last_subscription_state = new_state;
return true;
};
this->proxy_event_->SetSubscriptionStateChangeHandler(subscription_state_callback);
score::cpp::ignore = this->proxy_event_->SetSubscriptionStateChangeHandler(subscription_state_callback);

// When subscribed
this->proxy_event_->Subscribe(1U);
score::cpp::ignore = this->proxy_event_->Subscribe(1U);

// Then the callback is triggered with kSubscribed new status
EXPECT_EQ(this->proxy_event_->GetSubscriptionState(), SubscriptionState::kSubscribed);
Expand All @@ -372,10 +372,10 @@ TYPED_TEST(LolaProxyEventCommonFixture, RegisterSubscriptionStateChangeHandlerSe
last_subscription_state = new_state;
return new_state != SubscriptionState::kSubscribed;
};
this->proxy_event_->SetSubscriptionStateChangeHandler(subscription_state_callback);
score::cpp::ignore = this->proxy_event_->SetSubscriptionStateChangeHandler(subscription_state_callback);

// When subscribed
this->proxy_event_->Subscribe(1U);
score::cpp::ignore = this->proxy_event_->Subscribe(1U);

// Then the callback is triggered with kSubscribed new status
EXPECT_EQ(this->proxy_event_->GetSubscriptionState(), SubscriptionState::kSubscribed);
Expand All @@ -398,11 +398,11 @@ TYPED_TEST(LolaProxyEventCommonFixture, RegisterAndRemoveSubscriptionStateChange
last_subscription_state = new_state;
return true;
};
this->proxy_event_->SetSubscriptionStateChangeHandler(subscription_state_callback);
score::cpp::ignore = this->proxy_event_->SetSubscriptionStateChangeHandler(subscription_state_callback);

// When removing the callback and subscribing
this->proxy_event_->UnsetSubscriptionStateChangeHandler();
this->proxy_event_->Subscribe(1U);
score::cpp::ignore = this->proxy_event_->UnsetSubscriptionStateChangeHandler();
score::cpp::ignore = this->proxy_event_->Subscribe(1U);

// Then the callback is not triggered
EXPECT_EQ(this->proxy_event_->GetSubscriptionState(), SubscriptionState::kSubscribed);
Expand Down
8 changes: 4 additions & 4 deletions score/mw/com/impl/methods/proxy_method_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ TEST_F(ProxyMethodWithNonTrivialConstructibleInArgsAndReturnFixture,
this->GivenAValidProxyMethod();

// When calling InitializeInArgsAndReturnValues
this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());
score::cpp::ignore = this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());

// Then the zero copy call operator returns a pointer pointing to an initialized object (i.e. the non-trivial
// default constructor was called, initializing value to NonTriviallyConstructibleType::kInitialValue
Expand All @@ -1127,7 +1127,7 @@ TEST_F(ProxyMethodWithNonTrivialConstructibleInArgsAndReturnFixture,
this->GivenAValidProxyMethod();

// When calling InitializeInArgsAndReturnValues
this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());
score::cpp::ignore = this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());

// Then the copy call operator returns a pointer pointing to an initialized object (i.e. the non-trivial
// default constructor was called, initializing value to NonTriviallyConstructibleType::kInitialValue
Expand All @@ -1143,7 +1143,7 @@ TEST_F(ProxyMethodWithNonTrivialConstructibleInArgsOnlyFixture, InitializeInArgs
this->GivenAValidProxyMethod();

// When calling InitializeInArgsAndReturnValues
this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());
score::cpp::ignore = this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());

// Then Allocate returns a pointer pointing to an initialized object (i.e. the non-trivial default constructor was
// called, initializing value to NonTriviallyConstructibleType::kInitialValue
Expand Down Expand Up @@ -1182,7 +1182,7 @@ TEST_F(ProxyMethodWithNonTrivialConstructibleReturnOnlyFixture,
this->GivenAValidProxyMethod();

// When calling InitializeInArgsAndReturnValues
this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());
score::cpp::ignore = this->unit_->InitializeInArgsAndReturnValues(this->GetProxyBinding());

// Then the copy call operator returns a pointer pointing to an initialized object (i.e. the non-trivial
// default constructor was called, initializing value to NonTriviallyConstructibleType::kInitialValue
Expand Down
2 changes: 1 addition & 1 deletion score/mw/com/impl/skeleton_field_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ TEST_F(SkeletonFieldMoveConstructionFixture, SecondRegisterSetHandlerReplacesHan
MySetterAndGetterSkeleton unit2{std::move(unit)};

// Then the method should still be usable (validated by calling RegisterSetHandler which dispatches to the method)
unit2.my_setter_field_.RegisterSetHandler([](TestSampleType& /*value*/) noexcept {});
score::cpp::ignore = unit2.my_setter_field_.RegisterSetHandler([](TestSampleType& /*value*/) noexcept {});
}

TEST_F(SkeletonFieldMoveConstructionFixture,
Expand Down
2 changes: 1 addition & 1 deletion score/mw/com/impl/traits_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ TEST_F(GeneratedSkeletonCreationInstanceIdentifierTestFixture, CanInterpretAsSke
std::ignore = unit.some_field.Update(field_value);

// and registering a field set handler
unit.some_field.RegisterSetHandler([](TestSampleType&) {});
score::cpp::ignore = unit.some_field.RegisterSetHandler([](TestSampleType&) {});

// and offering the service
const auto result = unit.OfferService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class ProxyEventReceiver
std::cout << "ProxyEventReceiver: Received event notification" << std::endl;
received_sample_notification.notify();
};
proxy_event_or_field_.SetReceiveHandler(receive_handler);
score::cpp::ignore = proxy_event_or_field_.SetReceiveHandler(receive_handler);
}

~ProxyEventReceiver()
{
proxy_event_or_field_.UnsetReceiveHandler();
score::cpp::ignore = proxy_event_or_field_.UnsetReceiveHandler();
}

ProxyEventReceiver(const ProxyEventReceiver&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ProxyEventStateChangeNotifier

~ProxyEventStateChangeNotifier()
{
proxy_event_.UnsetSubscriptionStateChangeHandler();
score::cpp::ignore = proxy_event_.UnsetSubscriptionStateChangeHandler();
}

ProxyEventStateChangeNotifier(const ProxyEventStateChangeNotifier&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int run_provider(score::cpp::stop_token stop_token)
typed_sample->counter = i;

std::cout << "[PROVIDER] Sending sample: " << i << std::endl;
generic_event.Send(std::move(sample_res.value()));
score::cpp::ignore = generic_event.Send(std::move(sample_res.value()));
std::cout << "[PROVIDER] " << PAYLOAD_SIZE << "-byte Event Sent sample: " << i << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(10));
i++;
Expand Down Expand Up @@ -149,7 +149,7 @@ int run_consumer()

// Get reference to the GenericProxyEvent
auto& generic_event = event_it->second;
generic_event.Subscribe(kSamplesToSubscribe);
score::cpp::ignore = generic_event.Subscribe(kSamplesToSubscribe);

std::uint64_t expected{0};
std::uint64_t received{0};
Expand All @@ -159,7 +159,7 @@ int run_consumer()
while (received < kSamplesToProcess)
{
// The receiver callback operates on type-erased memory (SamplePtr<const void>)
generic_event.GetNewSamples(
score::cpp::ignore = generic_event.GetNewSamples(
[&](auto sample) {
auto* typed_sample = static_cast<const MyEventData*>(sample.get());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int run_provider(score::cpp::stop_token stop_token)
}
auto* typed_sample = static_cast<MyEventData*>(sample_res.value().Get());
typed_sample->counter = i;
generic_event.Send(std::move(sample_res.value()));
score::cpp::ignore = generic_event.Send(std::move(sample_res.value()));

score::mw::log::LogInfo("GenericSkeletonProvider") << PAYLOAD_SIZE << "-byte Event Sent sample: " << i;
std::this_thread::sleep_for(std::chrono::milliseconds(10));
Expand Down Expand Up @@ -158,11 +158,11 @@ int run_consumer()
std::uint64_t expected{0};
int data_mismatches{0};
bool is_first_sample{true};
proxy.event_.Subscribe(kSamplesToSubscribe);
score::cpp::ignore = proxy.event_.Subscribe(kSamplesToSubscribe);

while (received < kSamplesToProcess)
{
proxy.event_.GetNewSamples(
score::cpp::ignore = proxy.event_.GetNewSamples(
[&](score::mw::com::SamplePtr<MyEventData> sample) {
if (is_first_sample)
{
Expand Down
Loading