From 9bbcd716046bf2f938339c4f5469e09c9a8d067f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietrich=20Kr=C3=B6nke?= Date: Thu, 23 Sep 2021 17:38:54 +0200 Subject: [PATCH] iox-#910 Set callback function in waitset tests --- .../moduletests/test_notification_info.cpp | 13 +++- .../test/moduletests/test_subscriber.cpp | 10 +-- .../test/moduletests/test_user_trigger.cpp | 10 +-- .../test/moduletests/test_wait_set.cpp | 75 ++++++++++--------- 4 files changed, 58 insertions(+), 50 deletions(-) diff --git a/iceoryx_binding_c/test/moduletests/test_notification_info.cpp b/iceoryx_binding_c/test/moduletests/test_notification_info.cpp index 5a1404c9b1e..3febe8af1ab 100644 --- a/iceoryx_binding_c/test/moduletests/test_notification_info.cpp +++ b/iceoryx_binding_c/test/moduletests/test_notification_info.cpp @@ -91,6 +91,9 @@ class iox_notification_info_test : public Test return m_memoryManager.getChunk(chunkSettings); } + static void triggerCallback(iox_sub_t sub IOX_MAYBE_UNUSED) + { + } static UserTrigger* m_lastNotificationCallbackArgument; ConditionVariableData m_condVar{"myApp"}; @@ -142,7 +145,7 @@ TEST_F(iox_notification_info_test, notificationOriginIsUserTriggerPointerWhenIts TEST_F(iox_notification_info_test, notificationOriginIsSubscriberPointerWhenItsOriginatingFromThemStateBased) { - iox_ws_attach_subscriber_state(&m_waitSet, m_subscriberHandle, SubscriberState_HAS_DATA, 587U, NULL); + iox_ws_attach_subscriber_state(&m_waitSet, m_subscriberHandle, SubscriberState_HAS_DATA, 587U, triggerCallback); this->Subscribe(&m_portPtr); m_chunkPusher.push(getChunkFromMemoryManager()); @@ -154,7 +157,8 @@ TEST_F(iox_notification_info_test, notificationOriginIsSubscriberPointerWhenItsO TEST_F(iox_notification_info_test, notificationOriginIsSubscriberPointerWhenItsOriginatingFromThemEventBased) { - iox_ws_attach_subscriber_event(&m_waitSet, m_subscriberHandle, SubscriberEvent_DATA_RECEIVED, 587U, NULL); + iox_ws_attach_subscriber_event( + &m_waitSet, m_subscriberHandle, SubscriberEvent_DATA_RECEIVED, 587U, triggerCallback); this->Subscribe(&m_portPtr); m_chunkPusher.push(getChunkFromMemoryManager()); @@ -178,7 +182,7 @@ TEST_F(iox_notification_info_test, getOriginReturnsPointerToUserTriggerWhenOrigi TEST_F(iox_notification_info_test, getOriginReturnsPointerToSubscriberWhenOriginatingFromThemStateBased) { - iox_ws_attach_subscriber_state(&m_waitSet, m_subscriberHandle, SubscriberState_HAS_DATA, 587U, NULL); + iox_ws_attach_subscriber_state(&m_waitSet, m_subscriberHandle, SubscriberState_HAS_DATA, 587U, triggerCallback); this->Subscribe(&m_portPtr); m_chunkPusher.push(getChunkFromMemoryManager()); @@ -190,7 +194,8 @@ TEST_F(iox_notification_info_test, getOriginReturnsPointerToSubscriberWhenOrigin TEST_F(iox_notification_info_test, getOriginReturnsPointerToSubscriberWhenOriginatingFromThemEventBased) { - iox_ws_attach_subscriber_event(&m_waitSet, m_subscriberHandle, SubscriberEvent_DATA_RECEIVED, 587U, NULL); + iox_ws_attach_subscriber_event( + &m_waitSet, m_subscriberHandle, SubscriberEvent_DATA_RECEIVED, 587U, triggerCallback); this->Subscribe(&m_portPtr); m_chunkPusher.push(getChunkFromMemoryManager()); diff --git a/iceoryx_binding_c/test/moduletests/test_subscriber.cpp b/iceoryx_binding_c/test/moduletests/test_subscriber.cpp index 57d5e6ee61d..ddfea654f63 100644 --- a/iceoryx_binding_c/test/moduletests/test_subscriber.cpp +++ b/iceoryx_binding_c/test/moduletests/test_subscriber.cpp @@ -327,7 +327,7 @@ TEST_F(iox_sub_test, sendingTooMuchLeadsToOverflow) TEST_F(iox_sub_test, attachingToWaitSetWorks) { - EXPECT_EQ(iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 0U, NULL), + EXPECT_EQ(iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 0U, triggerCallback), WaitSetResult_SUCCESS); EXPECT_EQ(m_waitSet->size(), 1U); } @@ -335,9 +335,9 @@ TEST_F(iox_sub_test, attachingToWaitSetWorks) TEST_F(iox_sub_test, attachingToAnotherWaitsetCleansupAtOriginalWaitset) { WaitSetMock m_waitSet2{m_condVar}; - iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 0U, NULL); + iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 0U, triggerCallback); - EXPECT_EQ(iox_ws_attach_subscriber_state(&m_waitSet2, m_sut, SubscriberState_HAS_DATA, 0U, NULL), + EXPECT_EQ(iox_ws_attach_subscriber_state(&m_waitSet2, m_sut, SubscriberState_HAS_DATA, 0U, triggerCallback), WaitSetResult_SUCCESS); EXPECT_EQ(m_waitSet->size(), 0U); EXPECT_EQ(m_waitSet2.size(), 1U); @@ -345,14 +345,14 @@ TEST_F(iox_sub_test, attachingToAnotherWaitsetCleansupAtOriginalWaitset) TEST_F(iox_sub_test, detachingFromWaitSetWorks) { - iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 0U, NULL); + iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 0U, triggerCallback); iox_ws_detach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA); EXPECT_EQ(m_waitSet->size(), 0U); } TEST_F(iox_sub_test, hasDataTriggersWaitSetWithCorrectNotificationId) { - iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 587U, NULL); + iox_ws_attach_subscriber_state(m_waitSet.get(), m_sut, SubscriberState_HAS_DATA, 587U, triggerCallback); this->Subscribe(&m_portPtr); m_chunkPusher.push(getChunkFromMemoryManager()); diff --git a/iceoryx_binding_c/test/moduletests/test_user_trigger.cpp b/iceoryx_binding_c/test/moduletests/test_user_trigger.cpp index d16548b3a2c..a80cb3227ba 100644 --- a/iceoryx_binding_c/test/moduletests/test_user_trigger.cpp +++ b/iceoryx_binding_c/test/moduletests/test_user_trigger.cpp @@ -79,14 +79,14 @@ TEST_F(iox_user_trigger_test, cannotBeTriggeredWhenNotAttached) TEST_F(iox_user_trigger_test, canBeTriggeredWhenAttached) { - iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 0U, NULL); + iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 0U, triggerCallback); iox_user_trigger_trigger(m_sut); EXPECT_TRUE(iox_user_trigger_has_triggered(m_sut)); } TEST_F(iox_user_trigger_test, triggeringWaitSetResultsInCorrectNotificationId) { - iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 88191U, NULL); + iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 88191U, triggerCallback); iox_user_trigger_trigger(m_sut); auto eventVector = m_waitSet.wait(); @@ -111,9 +111,9 @@ TEST_F(iox_user_trigger_test, triggeringWaitSetResultsInCorrectCallback) TEST_F(iox_user_trigger_test, attachingToAnotherWaitSetCleansupFirstWaitset) { WaitSetMock m_waitSet2{m_condVar}; - iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 0U, NULL); + iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 0U, triggerCallback); - iox_ws_attach_user_trigger_event(&m_waitSet2, m_sut, 0U, NULL); + iox_ws_attach_user_trigger_event(&m_waitSet2, m_sut, 0U, triggerCallback); EXPECT_EQ(m_waitSet.size(), 0U); EXPECT_EQ(m_waitSet2.size(), 1U); @@ -122,7 +122,7 @@ TEST_F(iox_user_trigger_test, attachingToAnotherWaitSetCleansupFirstWaitset) TEST_F(iox_user_trigger_test, disable_trigger_eventingItFromWaitsetCleansup) { WaitSetMock m_waitSet2{m_condVar}; - iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 0U, NULL); + iox_ws_attach_user_trigger_event(&m_waitSet, m_sut, 0U, triggerCallback); iox_ws_detach_user_trigger_event(&m_waitSet, m_sut); diff --git a/iceoryx_binding_c/test/moduletests/test_wait_set.cpp b/iceoryx_binding_c/test/moduletests/test_wait_set.cpp index f5d74adaa08..8ece60c7705 100644 --- a/iceoryx_binding_c/test/moduletests/test_wait_set.cpp +++ b/iceoryx_binding_c/test/moduletests/test_wait_set.cpp @@ -142,7 +142,7 @@ TEST_F(iox_ws_test, SizeIsZeroWhenConstructed) TEST_F(iox_ws_test, SizeIsOneWhenOneUserTriggerIsAttached) { - EXPECT_EQ(iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL), + EXPECT_EQ(iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback), iox_WaitSetResult::WaitSetResult_SUCCESS); EXPECT_EQ(iox_ws_size(m_sut), 1U); } @@ -150,7 +150,8 @@ TEST_F(iox_ws_test, SizeIsOneWhenOneUserTriggerIsAttached) TEST_F(iox_ws_test, SizeIsOneWhenOneSubscriberStateIsAttached) { constexpr uint64_t customId = 123U; - EXPECT_EQ(iox_ws_attach_subscriber_state(m_sut, &m_subscriberVector[0U], SubscriberState_HAS_DATA, customId, NULL), + EXPECT_EQ(iox_ws_attach_subscriber_state( + m_sut, &m_subscriberVector[0U], SubscriberState_HAS_DATA, customId, subscriberCallback), iox_WaitSetResult::WaitSetResult_SUCCESS); EXPECT_EQ(iox_ws_size(m_sut), 1U); } @@ -158,9 +159,9 @@ TEST_F(iox_ws_test, SizeIsOneWhenOneSubscriberStateIsAttached) TEST_F(iox_ws_test, SizeIsOneWhenOneSubscriberEventIsAttached) { constexpr uint64_t customId = 123U; - EXPECT_EQ( - iox_ws_attach_subscriber_event(m_sut, &m_subscriberVector[0U], SubscriberEvent_DATA_RECEIVED, customId, NULL), - iox_WaitSetResult::WaitSetResult_SUCCESS); + EXPECT_EQ(iox_ws_attach_subscriber_event( + m_sut, &m_subscriberVector[0U], SubscriberEvent_DATA_RECEIVED, customId, subscriberCallback), + iox_WaitSetResult::WaitSetResult_SUCCESS); EXPECT_EQ(iox_ws_size(m_sut), 1U); } @@ -168,11 +169,12 @@ TEST_F(iox_ws_test, AttachingMoreUserTriggerThanCapacityAvailableFails) { for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - EXPECT_EQ(iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL), + EXPECT_EQ(iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback), iox_WaitSetResult::WaitSetResult_SUCCESS); EXPECT_EQ(iox_ws_size(m_sut), i + 1U); } - EXPECT_EQ(iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET], 0U, NULL), + EXPECT_EQ(iox_ws_attach_user_trigger_event( + m_sut, m_userTrigger[MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET], 0U, userTriggerCallback), iox_WaitSetResult::WaitSetResult_WAIT_SET_FULL); } @@ -181,16 +183,16 @@ TEST_F(iox_ws_test, AttachingMoreSubscriberStatesThanCapacityAvailableFails) constexpr uint64_t customId = 123U; for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - EXPECT_EQ( - iox_ws_attach_subscriber_state(m_sut, &m_subscriberVector[i], SubscriberState_HAS_DATA, customId, NULL), - iox_WaitSetResult::WaitSetResult_SUCCESS); + EXPECT_EQ(iox_ws_attach_subscriber_state( + m_sut, &m_subscriberVector[i], SubscriberState_HAS_DATA, customId, subscriberCallback), + iox_WaitSetResult::WaitSetResult_SUCCESS); EXPECT_EQ(iox_ws_size(m_sut), i + 1U); } EXPECT_EQ(iox_ws_attach_subscriber_state(m_sut, &m_subscriberVector[MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET], SubscriberState_HAS_DATA, customId, - NULL), + subscriberCallback), iox_WaitSetResult::WaitSetResult_WAIT_SET_FULL); } @@ -200,7 +202,7 @@ TEST_F(iox_ws_test, AttachingMoreSubscriberEventsThanCapacityAvailableFails) for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { EXPECT_EQ(iox_ws_attach_subscriber_event( - m_sut, &m_subscriberVector[i], SubscriberEvent_DATA_RECEIVED, customId, NULL), + m_sut, &m_subscriberVector[i], SubscriberEvent_DATA_RECEIVED, customId, subscriberCallback), iox_WaitSetResult::WaitSetResult_SUCCESS); EXPECT_EQ(iox_ws_size(m_sut), i + 1U); } @@ -208,13 +210,13 @@ TEST_F(iox_ws_test, AttachingMoreSubscriberEventsThanCapacityAvailableFails) &m_subscriberVector[MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET], SubscriberEvent_DATA_RECEIVED, customId, - NULL), + subscriberCallback), iox_WaitSetResult::WaitSetResult_WAIT_SET_FULL); } TEST_F(iox_ws_test, SizeDecreasesWhenAttachedUserTriggerIsDeinitialized) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback); iox_ws_detach_user_trigger_event(m_sut, m_userTrigger[0U]); EXPECT_EQ(iox_ws_size(m_sut), 0U); } @@ -222,7 +224,8 @@ TEST_F(iox_ws_test, SizeDecreasesWhenAttachedUserTriggerIsDeinitialized) TEST_F(iox_ws_test, SizeDecreasesWhenAttachedSubscriberStateIsDeinitialized) { constexpr uint64_t customId = 123U; - EXPECT_EQ(iox_ws_attach_subscriber_state(m_sut, &m_subscriberVector[0U], SubscriberState_HAS_DATA, customId, NULL), + EXPECT_EQ(iox_ws_attach_subscriber_state( + m_sut, &m_subscriberVector[0U], SubscriberState_HAS_DATA, customId, subscriberCallback), iox_WaitSetResult::WaitSetResult_SUCCESS); iox_ws_detach_subscriber_state(m_sut, &m_subscriberVector[0U], SubscriberState_HAS_DATA); EXPECT_EQ(iox_ws_size(m_sut), 0U); @@ -231,16 +234,16 @@ TEST_F(iox_ws_test, SizeDecreasesWhenAttachedSubscriberStateIsDeinitialized) TEST_F(iox_ws_test, SizeDecreasesWhenAttachedSubscriberEventIsDeinitialized) { constexpr uint64_t customId = 123U; - EXPECT_EQ( - iox_ws_attach_subscriber_event(m_sut, &m_subscriberVector[0U], SubscriberEvent_DATA_RECEIVED, customId, NULL), - iox_WaitSetResult::WaitSetResult_SUCCESS); + EXPECT_EQ(iox_ws_attach_subscriber_event( + m_sut, &m_subscriberVector[0U], SubscriberEvent_DATA_RECEIVED, customId, subscriberCallback), + iox_WaitSetResult::WaitSetResult_SUCCESS); iox_ws_detach_subscriber_event(m_sut, &m_subscriberVector[0U], SubscriberEvent_DATA_RECEIVED); EXPECT_EQ(iox_ws_size(m_sut), 0U); } TEST_F(iox_ws_test, NumberOfTriggeredConditionsIsOneWhenOneWasTriggered) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[0U]); EXPECT_EQ(iox_ws_wait(m_sut, m_eventInfoStorage, MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET, &m_missedElements), 1U); @@ -250,7 +253,7 @@ TEST_F(iox_ws_test, NumberOfTriggeredConditionsIsCorrectWhenMultipleWereTriggere { for (uint64_t i = 0U; i < 10U; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -261,7 +264,7 @@ TEST_F(iox_ws_test, NumberOfTriggeredConditionsIsCorrectWhenAllWereTriggered) { for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -271,7 +274,7 @@ TEST_F(iox_ws_test, NumberOfTriggeredConditionsIsCorrectWhenAllWereTriggered) TEST_F(iox_ws_test, SingleTriggerCaseWaitReturnsCorrectTrigger) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0], 5678U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0], 5678U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[0U]); iox_ws_wait(m_sut, m_eventInfoStorage, MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET, &m_missedElements); @@ -286,7 +289,7 @@ TEST_F(iox_ws_test, MultiTriggerCaseWaitReturnsCorrectTrigger) { for (uint64_t i = 0U; i < 8; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 1337U + i, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 1337U + i, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -304,7 +307,7 @@ TEST_F(iox_ws_test, MaxTriggerCaseWaitReturnsCorrectTrigger) { for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 42U * i + 1U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 42U * i + 1U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -320,7 +323,7 @@ TEST_F(iox_ws_test, MaxTriggerCaseWaitReturnsCorrectTrigger) TEST_F(iox_ws_test, TimedWaitNumberOfTriggeredConditionsIsOneWhenOneWasTriggered) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[0U]); EXPECT_EQ(iox_ws_timed_wait( @@ -332,7 +335,7 @@ TEST_F(iox_ws_test, TimedWaitNumberOfTriggeredConditionsIsCorrectWhenMultipleWer { for (uint64_t i = 0U; i < 10U; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -345,7 +348,7 @@ TEST_F(iox_ws_test, TimedWaitNumberOfTriggeredConditionsIsCorrectWhenAllWereTrig { for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -356,7 +359,7 @@ TEST_F(iox_ws_test, TimedWaitNumberOfTriggeredConditionsIsCorrectWhenAllWereTrig TEST_F(iox_ws_test, SingleTriggerCaseTimedWaitReturnsCorrectTrigger) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 5678U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 5678U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[0U]); iox_ws_timed_wait(m_sut, m_timeout, m_eventInfoStorage, MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET, &m_missedElements); @@ -371,7 +374,7 @@ TEST_F(iox_ws_test, MultiTriggerCaseTimedWaitReturnsCorrectTrigger) { for (uint64_t i = 0U; i < 8U; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 1337U + i, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 1337U + i, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -389,7 +392,7 @@ TEST_F(iox_ws_test, MaxTriggerCaseTimedWaitReturnsCorrectTrigger) { for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 42U * i + 1U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 42U * i + 1U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -407,7 +410,7 @@ TEST_F(iox_ws_test, MissedElementsIsZeroWhenNothingWasMissed) { for (uint64_t i = 0U; i < 12U; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -420,7 +423,7 @@ TEST_F(iox_ws_test, MissedElementsIsCorrectWhenSomethingWasMissed) { for (uint64_t i = 0U; i < 12U; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -433,7 +436,7 @@ TEST_F(iox_ws_test, MissedElementsIsCorrectWhenAllWereMissed) { for (uint64_t i = 0U; i < MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; ++i) { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[i], 0U, userTriggerCallback); iox_user_trigger_trigger(m_userTrigger[i]); } @@ -443,7 +446,7 @@ TEST_F(iox_ws_test, MissedElementsIsCorrectWhenAllWereMissed) } TIMING_TEST_F(iox_ws_test, WaitIsBlockingTillTriggered, Repeat(5), [&] { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback); std::atomic_bool waitWasCalled{false}; std::thread t([&] { @@ -480,7 +483,7 @@ TIMING_TEST_F(iox_ws_test, WaitIsNonBlockingAfterMarkForDestruction, Repeat(5), TIMING_TEST_F(iox_ws_test, TimedWaitIsBlockingTillTriggered, Repeat(5), [&] { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback); std::atomic_bool waitWasCalled{false}; std::thread t([&] { @@ -516,7 +519,7 @@ TIMING_TEST_F(iox_ws_test, TimedWaitIsNonBlockingAfterMarkForDestruction, Repeat }); TIMING_TEST_F(iox_ws_test, TimedWaitBlocksTillTimeout, Repeat(5), [&] { - iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, NULL); + iox_ws_attach_user_trigger_event(m_sut, m_userTrigger[0U], 0U, userTriggerCallback); std::atomic_bool waitWasCalled{false}; std::thread t([&] {