Add unit test for OCSetPlatformInfo()
authorRavi Nanjundappa <nravi.n@samsung.com>
Mon, 28 Sep 2015 05:05:23 +0000 (10:35 +0530)
committerJon A. Cruz <jonc@osg.samsung.com>
Tue, 29 Sep 2015 18:50:56 +0000 (18:50 +0000)
Unit tests exercise code paths to check OCSetPlatformInfo()
for Client Mode.

Change-Id: I5b4fda023fd91826117cc27a1eb8f1578f94b958
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3173
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
resource/csdk/stack/test/stacktests.cpp

index c92898229f2d460d8fe437bffdc52ca2d11b0643..dbf73d72b2c5b8513ff419b11eee6e9b9b63ba3f 100644 (file)
@@ -204,6 +204,21 @@ TEST(StackStart, SetPlatformInfoValid)
     EXPECT_EQ(OC_STACK_OK, OCStop());
 }
 
+TEST(StackStart, SetPlatformInfoWithClientMode)
+{
+    itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);
+    EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_CLIENT));
+
+    OCPlatformInfo info =
+    {
+        gDeviceUUID,
+        gManufacturerName,
+        0, 0, 0, 0, 0, 0, 0, 0, 0
+    };
+    EXPECT_EQ(OC_STACK_ERROR, OCSetPlatformInfo(info));
+    EXPECT_EQ(OC_STACK_OK, OCStop());
+}
+
 TEST(StackStart, SetPlatformInfoWithNoPlatformID)
 {
     itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT);