From 26f6db12db968028bd5e477a9e10135fcaa0868a Mon Sep 17 00:00:00 2001 From: Andrzej Popowski Date: Thu, 28 Jul 2016 11:24:27 +0200 Subject: [PATCH] [Iotcon] - fixing bugs to pass TCT tests Change-Id: I262dcc13661f4a9ae5ee4a69b45084a179765af1 Signed-off-by: Andrzej Popowski --- src/iotcon/iotcon_api.js | 28 +++++++++++++++++++++++----- src/iotcon/iotcon_client_manager.cc | 2 +- src/iotcon/iotcon_instance.cc | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) 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 -- 2.34.1