From 7ac769faf9b8b27034e89bca505b50d81289d9c3 Mon Sep 17 00:00:00 2001 From: KIM JungYong Date: Fri, 26 Aug 2016 19:53:46 +0900 Subject: [PATCH] Fix unit test of notification provider service. unit test bug is fixed at notification provider service. Change-Id: I83882ceb626be56fc47d5da2cb6eda60e17207e9 Signed-off-by: KIM JungYong Reviewed-on: https://gerrit.iotivity.org/gerrit/10961 Reviewed-by: Uze Choi Tested-by: jenkins-iotivity --- service/notification/unittest/NSProviderTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/notification/unittest/NSProviderTest.cpp b/service/notification/unittest/NSProviderTest.cpp index a3fce33..989a8bd 100755 --- a/service/notification/unittest/NSProviderTest.cpp +++ b/service/notification/unittest/NSProviderTest.cpp @@ -177,7 +177,8 @@ TEST_F(NotificationProviderTest, StartProviderPositiveWithNSPolicyFalse) TEST_F(NotificationProviderTest, ExpectCallbackWhenReceiveSubscribeRequestWithAccepterProvider) { - mocks.ExpectCallFunc(NSRequestedSubscribeCallbackEmpty).Do( + g_consumer = NULL; + mocks.OnCallFunc(NSRequestedSubscribeCallbackEmpty).Do( [](NSConsumer * consumer) { std::cout << "NSRequestedSubscribeCallback" << std::endl; @@ -205,6 +206,8 @@ TEST_F(NotificationProviderTest, ExpectCallbackWhenReceiveSubscribeRequestWithAc std::unique_lock< std::mutex > lock{ mutexForCondition }; responseCon.wait_for(lock, std::chrono::milliseconds(1000)); + + EXPECT_NE((void*)g_consumer, (void*)NULL); } TEST_F(NotificationProviderTest, NeverCallNotifyOnConsumerByAcceptIsFalse) -- 2.7.4