Fix unit test of notification provider service.
authorKIM JungYong <jyong2.kim@samsung.com>
Fri, 26 Aug 2016 10:53:46 +0000 (19:53 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 29 Aug 2016 06:00:44 +0000 (06:00 +0000)
unit test bug is fixed at notification provider service.

Change-Id: I83882ceb626be56fc47d5da2cb6eda60e17207e9
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10961
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
service/notification/unittest/NSProviderTest.cpp

index a3fce33..989a8bd 100755 (executable)
@@ -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)