From: Ravi Nanjundappa Date: Mon, 29 Jun 2015 05:38:27 +0000 (+0530) Subject: Added one more unit test for OCCreateResource X-Git-Tag: 1.2.0+RC1~1540 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf3be25d0d150feb858bc5860a3cb57fb0749008;p=platform%2Fupstream%2Fiotivity.git Added one more unit test for OCCreateResource * Unit test to exercise code path to check OCCreateResource() when the resource policy is non-discoverable & non-observable. Change-Id: Ifd95cd6f48a498fbc81c5c62fd7c8df91855f40b Signed-off-by: Ravi Nanjundappa Reviewed-on: https://gerrit.iotivity.org/gerrit/1438 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane --- diff --git a/resource/csdk/stack/test/stacktests.cpp b/resource/csdk/stack/test/stacktests.cpp index 8ec27f4..dff43c6 100644 --- a/resource/csdk/stack/test/stacktests.cpp +++ b/resource/csdk/stack/test/stacktests.cpp @@ -423,6 +423,28 @@ TEST(StackResource, CreateResourceSuccess) EXPECT_EQ(OC_STACK_OK, OCStop()); } +TEST(StackResource, CreateResourceSuccessWithResourcePolicyPropNone) +{ + itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT); + OC_LOG(INFO, TAG, "Starting CreateResourceSuccessWithResourcePolicyPropNone test"); + InitStack(OC_SERVER); + + OCResourceHandle handle; + // the resource is non-discoverable & non-observable by the client. + EXPECT_EQ(OC_STACK_OK, OCCreateResource(&handle, + "core.led", + "core.rw", + "/a/led", + 0, + NULL, + OC_RES_PROP_NONE));// the resource is non-discoverable & + // non-observable by the client. + const char* url = OCGetResourceUri(handle); + EXPECT_STREQ("/a/led", url); + + EXPECT_EQ(OC_STACK_OK, OCStop()); +} + TEST(StackResource, CreateResourceWithClientStackMode) { itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);