From: Jay Sharma Date: Thu, 31 Mar 2016 14:41:37 +0000 (+0530) Subject: [Easy-Setup] Fixed SVACE issues. X-Git-Tag: 1.2.0+RC1~470 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a755f0487af05031eda7897ae3fdd29d864668b8;p=platform%2Fupstream%2Fiotivity.git [Easy-Setup] Fixed SVACE issues. Change-Id: Id2722e42ac6958e57a46f6cb8480395788697b10 Signed-off-by: Jay Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/7501 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka (cherry picked from commit bd4708f5b3a1fc5b522a3128c0d374d44eb56568) Reviewed-on: https://gerrit.iotivity.org/gerrit/7513 Reviewed-by: Jon A. Cruz --- diff --git a/service/easy-setup/mediator/richsdk/inc/RemoteEnrolleeResource.h b/service/easy-setup/mediator/richsdk/inc/RemoteEnrolleeResource.h index 019a514..6828a9b 100755 --- a/service/easy-setup/mediator/richsdk/inc/RemoteEnrolleeResource.h +++ b/service/easy-setup/mediator/richsdk/inc/RemoteEnrolleeResource.h @@ -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; diff --git a/service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp b/service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp index f3414f6..b401b27 100755 --- a/service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp +++ b/service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp @@ -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; diff --git a/service/easy-setup/mediator/richsdk/unittests/MediatorRichTest.cpp b/service/easy-setup/mediator/richsdk/unittests/MediatorRichTest.cpp index e2b67ef..4f037b8 100644 --- a/service/easy-setup/mediator/richsdk/unittests/MediatorRichTest.cpp +++ b/service/easy-setup/mediator/richsdk/unittests/MediatorRichTest.cpp @@ -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]