From bbc13314ed1d4f6d2154918da335f6ae085d144e Mon Sep 17 00:00:00 2001 From: "jaesick.shin" Date: Mon, 22 Aug 2016 12:45:10 +0900 Subject: [PATCH] Modify unittest for ExpectCallNotifyOnConsumerByAcceptIsTrue. this unittest is sometimes success or fail. Change-Id: I5db819e90919c9db1281b0853c44214cbf58cc43 Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/10701 Reviewed-by: Chihyun Cho Reviewed-by: Hun-je Yeon Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- service/notification/unittest/NSProviderTest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service/notification/unittest/NSProviderTest.cpp b/service/notification/unittest/NSProviderTest.cpp index efb86b5..442739d 100755 --- a/service/notification/unittest/NSProviderTest.cpp +++ b/service/notification/unittest/NSProviderTest.cpp @@ -244,7 +244,6 @@ TEST_F(NotificationProviderTest, NeverCallNotifyOnConsumerByAcceptIsFalse) NSAcceptSubscription(g_consumer, true); } -/* TODO coap+tcp case is ERROR, After, will be change code. TEST_F(NotificationProviderTest, ExpectCallNotifyOnConsumerByAcceptIsTrue) { int msgID; @@ -252,16 +251,18 @@ TEST_F(NotificationProviderTest, ExpectCallNotifyOnConsumerByAcceptIsTrue) mocks.ExpectCallFunc(NSMessageCallbackFromConsumerEmpty).Do( [&msgID](const int &id, const std::string&, const std::string&, const std::string&) { + std::cout << "id : " << id << std::endl; if (id == msgID) { std::cout << "ExpectCallNotifyOnConsumerByAcceptIsTrue" << std::endl; } + responseCon.notify_all(); }); NSAcceptSubscription(g_consumer, true); NSMessage * msg = new NSMessage(); - msgID = (int)msg->messageId; + msgID = 10; msg->title = strdup(std::string("Title").c_str()); msg->contentText = strdup(std::string("ContentText").c_str()); msg->sourceName = strdup(std::string("OCF").c_str()); @@ -269,7 +270,7 @@ TEST_F(NotificationProviderTest, ExpectCallNotifyOnConsumerByAcceptIsTrue) std::unique_lock< std::mutex > lock{ mutexForCondition }; responseCon.wait(lock); -}*/ +} TEST_F(NotificationProviderTest, ExpectCallbackSyncOnReadToConsumer) { -- 2.7.4