our service is two case for startProvider.
Add startProvider with NSPolicy False Case.
Change-Id: I3aa763aaf264240ba4a9122fe3071a30edb40bcb
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9821
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
-TEST_F(NotificationProviderTest, StartProviderPositive)
+TEST_F(NotificationProviderTest, StartProviderPositiveWithNSPolicyTrue)
{
NSResult ret = NSStartProvider(true,
NSRequestedSubscribeCallbackEmpty,
{
NSResult ret = NSStartProvider(true,
NSRequestedSubscribeCallbackEmpty,
+TEST_F(NotificationProviderTest, StartProviderPositiveWithNSPolicyFalse)
+{
+ NSResult ret = NSStartProvider(false,
+ NSRequestedSubscribeCallbackEmpty,
+ NSSyncCallbackEmpty);
+
+ std::unique_lock< std::mutex > lock{ mutexForCondition };
+ responseCon.wait_for(lock, std::chrono::milliseconds(3000));
+ g_consumerSimul.findProvider();
+
+ responseCon.wait_for(lock, std::chrono::milliseconds(3000));
+ NSStopProvider();
+ EXPECT_EQ(ret, NS_OK);
+}
+
TEST_F(NotificationProviderTest, ExpectCallbackWhenReceiveSubscribeRequestWithAccepterProvider)
{
mocks.ExpectCallFunc(NSRequestedSubscribeCallbackEmpty).Do(
TEST_F(NotificationProviderTest, ExpectCallbackWhenReceiveSubscribeRequestWithAccepterProvider)
{
mocks.ExpectCallFunc(NSRequestedSubscribeCallbackEmpty).Do(