resource: Add test for ConstructResourceObject without coap scheme
authorRavi Nanjundappa <nravi.n@samsung.com>
Mon, 14 Sep 2015 13:42:31 +0000 (19:12 +0530)
committerJon A. Cruz <jonc@osg.samsung.com>
Fri, 18 Sep 2015 18:46:58 +0000 (18:46 +0000)
Added a test case for ConstructResourceTest to simulate the scenario
of Resource creation with no "coap" scheme in the the host value

Change-Id: Iaec6f6f0038a049b969d08685cc057e6bae80455
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2517
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
resource/unittests/OCResourceTest.cpp

index fa74d288467cb36561ed1b5ccc89c30ad4e520b4..5f2403eae50d0e3642da3978922ab7019725bb6f 100644 (file)
@@ -71,6 +71,11 @@ namespace OCResourceTest
         EXPECT_ANY_THROW(ConstructResourceObject(std::string(""), std::string("")));
     }
 
+    TEST(ConstructResourceTest, ConstructResourceObjectWithoutCoapScheme)
+    {
+        EXPECT_ANY_THROW(ConstructResourceObject("//192.168.1.2:5000", "/resource"));
+    }
+
     TEST(ConstructResourceTest, ConstructResourceObjectWithoutPortNumber)
     {
         EXPECT_ANY_THROW(ConstructResourceObject("coap://192.168.1.2", "/resource"));