[Easy-Setup] Fixed SVACE issues.
authorJay Sharma <jay.sharma@samsung.com>
Thu, 31 Mar 2016 14:41:37 +0000 (20:11 +0530)
committerJon A. Cruz <jon@joncruz.org>
Fri, 1 Apr 2016 06:56:08 +0000 (06:56 +0000)
Change-Id: Id2722e42ac6958e57a46f6cb8480395788697b10
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7501
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
(cherry picked from commit bd4708f5b3a1fc5b522a3128c0d374d44eb56568)
Reviewed-on: https://gerrit.iotivity.org/gerrit/7513
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
service/easy-setup/mediator/richsdk/inc/RemoteEnrolleeResource.h
service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp
service/easy-setup/mediator/richsdk/unittests/MediatorRichTest.cpp

index 019a51494f00f3d7c39029c82c4f7d7dc41a6980..6828a9b9937d2b91f2457b2ab90e681587e760c6 100755 (executable)
@@ -58,7 +58,8 @@ namespace OIC
              *
              * @throw ESBadRequestException is thrown if the parameters are invalid
              */
-            RemoteEnrolleeResource(ProvConfig enrolleeNWProvInfo, WiFiOnboadingConnection onboardingconn);
+            RemoteEnrolleeResource(const ProvConfig &enrolleeNWProvInfo,
+                                               const WiFiOnboadingConnection &onboardingconn);
 
             ~RemoteEnrolleeResource() = default;
 
index f3414f6d72992ea4a3ec4726726447c7492e0423..b401b27e243e559594858bc11bc3b7183bff935f 100755 (executable)
@@ -39,8 +39,8 @@ namespace OIC
         static const char ES_PROV_RES_URI[] = "/oic/prov";
         static const char ES_PROV_RES_TYPE[] = "oic.r.prov";
 
-        RemoteEnrolleeResource::RemoteEnrolleeResource(ProvConfig provConfig,
-                                                  WiFiOnboadingConnection onboardingconn)
+        RemoteEnrolleeResource::RemoteEnrolleeResource(const ProvConfig &provConfig,
+                                                  const WiFiOnboadingConnection &onboardingconn)
         {
             m_ProvConfig = provConfig;
             m_wifiOnboardingconn = onboardingconn;
index e2b67ef166286c2c64a80ae08f2df75fc2bb7597..4f037b8953650af0169c7852837961a73a7abba5 100644 (file)
@@ -95,10 +95,18 @@ TEST_F(MediatorRichTest, testCreateEnrolleeDevice)
 TEST_F(MediatorRichTest, testCreateEnrolleeDeviceNegative)
 {
     RemoteEnrollee::shared_ptr remoteEnrollee = NULL;
-    ProvConfig netInfo ;
+    ProvConfig netInfo;
     WiFiOnboadingConnection onboardingConn;
     EasySetup *easysetupInstance = EasySetup::getInstance();
 
+    netInfo.connType = CT_ADAPTER_IP;
+
+    OICStrcpy(netInfo.provData.WIFI.ssid, NET_WIFI_SSID_SIZE - 1, ssid.c_str());
+    OICStrcpy(netInfo.provData.WIFI.pwd, NET_WIFI_PWD_SIZE - 1, pwd.c_str());
+
+    onboardingConn.isSecured = false;
+    OICStrcpy(onboardingConn.ipAddress, IPV4_ADDR_SIZE - 1, ipaddress.c_str());
+
     //calling the createEnrolleeDevice
     remoteEnrollee = easysetupInstance->createEnrolleeDevice(netInfo, onboardingConn);
     //calling again the createEnrolleeDevice with same config & connection info [API throws the exception]