From: Andrzej Popowski Date: Thu, 28 Jul 2016 09:24:27 +0000 (+0200) Subject: [Iotcon] - fixing bugs to pass TCT tests X-Git-Tag: submit/tizen/20160808.053811~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F81945%2F1;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Iotcon] - fixing bugs to pass TCT tests Change-Id: I262dcc13661f4a9ae5ee4a69b45084a179765af1 Signed-off-by: Andrzej Popowski --- diff --git a/src/iotcon/iotcon_api.js b/src/iotcon/iotcon_api.js index fa5899b0..55e19bb4 100644 --- a/src/iotcon/iotcon_api.js +++ b/src/iotcon/iotcon_api.js @@ -178,18 +178,36 @@ function DeviceInfo(data) { function IotconOption(id, data) { validator.isConstructorCall(this, tizen.IotconOption); + var _id = 0; + var _data = ''; + Object.defineProperties(this, { id: { - value: id, - writable: false, + get: function() { + return _id; + }, + set: function(v) { + if (v) { + _id = v; + } + }, enumerable: true }, data: { - value: data, - writable: false, + get: function() { + return _data; + }, + set: function(v) { + if (v) { + _data = v; + } + }, enumerable: true } }); + + this["id"] = id; + this["data"] = data; } function PlatformInfo(data) { @@ -1078,7 +1096,7 @@ Server.prototype.createResource = function() { name: 'dictionary', type: types.DICTIONARY, optional: true, - nullable: true + nullable: false }]); var callArgs = args.dictionary || {}; diff --git a/src/iotcon/iotcon_client_manager.cc b/src/iotcon/iotcon_client_manager.cc index 41f9c3b9..7ecd9bb1 100644 --- a/src/iotcon/iotcon_client_manager.cc +++ b/src/iotcon/iotcon_client_manager.cc @@ -84,7 +84,7 @@ common::TizenResult IotconClientManager::AddPresenceEventListener( presence->id = GetPresenceNextId(); presence_map_.insert(std::make_pair(presence->id, presence)); - return TizenSuccess(); + return result; } common::TizenResult IotconClientManager::RemovePresenceEventListener(long long id) { diff --git a/src/iotcon/iotcon_instance.cc b/src/iotcon/iotcon_instance.cc index 7e7b5fb6..29af6414 100644 --- a/src/iotcon/iotcon_instance.cc +++ b/src/iotcon/iotcon_instance.cc @@ -85,7 +85,7 @@ const std::string kResult = "result"; const std::string kTimeout = "timeout"; const std::string kData = "data"; -const std::string kVirtualResourcesHandlingPath = "/home/tmp_file_iotcon.dat"; +const std::string kVirtualResourcesHandlingPath = "/home/owner/share/tmp_file_iotcon.dat"; } // namespace