From 90f3b730726833974b1bd51ed917982a98f467f1 Mon Sep 17 00:00:00 2001 From: Habib Virji Date: Thu, 5 Jan 2017 14:47:13 +0000 Subject: [PATCH] Fix setPropertyValue and getPropertyValue Fix an issue in setPropertyValue for not able to set dmv value. Return value of getPropertyValue fixed. BUG:https://jira.iotivity.org/browse/IOT-1724 BUG:https://jira.iotivity.org/browse/IOT-1725 Change-Id: I118c48b70ae6605a8ca19a292411898e7f5fa74d Signed-off-by: Habib Virji Reviewed-on: https://gerrit.iotivity.org/gerrit/16163 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- resource/csdk/stack/src/ocresource.c | 24 +++++++++------- resource/csdk/stack/test/stacktests.cpp | 19 ++++++------- resource/examples/simpleserver.cpp | 38 ++++++------------------- resource/include/IServerWrapper.h | 8 ++++-- resource/include/InProcServerWrapper.h | 9 ++++-- resource/include/OCPlatform.h | 12 +++++--- resource/include/OCPlatform_impl.h | 11 ++++++-- resource/src/InProcServerWrapper.cpp | 36 ++++++++++++++++++++++-- resource/src/OCPlatform.cpp | 15 ++++++++-- resource/src/OCPlatform_impl.cpp | 33 ++++++++++++++-------- resource/unittests/OCPlatformTest.cpp | 50 +++++++++++++++++++++++++++++++-- 11 files changed, 174 insertions(+), 81 deletions(-) diff --git a/resource/csdk/stack/src/ocresource.c b/resource/csdk/stack/src/ocresource.c index 3fd84f5..614c1ac 100755 --- a/resource/csdk/stack/src/ocresource.c +++ b/resource/csdk/stack/src/ocresource.c @@ -1469,7 +1469,6 @@ exit: OCStackResult OCSetDeviceInfo(OCDeviceInfo info) { - OCStringLL *dataModelVersion = NULL; OCResource *resource = FindResourceByUri(OC_RSRVD_DEVICE_URI); if (!resource) { @@ -1498,23 +1497,24 @@ OCStackResult OCSetDeviceInfo(OCDeviceInfo info) } VERIFY_SUCCESS(OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, info.specVersion ? info.specVersion: OC_SPEC_VERSION)); + if (info.dataModelVersions) { - VERIFY_SUCCESS(OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, info.dataModelVersions)); + char *dmv = OCCreateString(info.dataModelVersions); + VERIFY_PARAM_NON_NULL(TAG, dmv, "Failed allocating dataModelVersions"); + OCStackResult r = OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, dmv); + OICFree(dmv); + VERIFY_SUCCESS(r); } else { - dataModelVersion = OCCreateOCStringLL(OC_DATA_MODEL_VERSION); - VERIFY_SUCCESS(OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, dataModelVersion)); + VERIFY_SUCCESS(OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + OC_DATA_MODEL_VERSION)); } OIC_LOG(INFO, TAG, "Device parameter initialized successfully."); return OC_STACK_OK; exit: - if (dataModelVersion) - { - OCFreeOCStringLL(dataModelVersion); - } return OC_STACK_ERROR; } @@ -1550,7 +1550,7 @@ OCStackResult OCGetAttribute(const OCResource *resource, const char *attribute, OCStackResult OCGetPropertyValue(OCPayloadType type, const char *prop, void **value) { - if (!prop || *value) + if (!prop) { return OC_STACK_INVALID_PARAM; } @@ -1558,6 +1558,10 @@ OCStackResult OCGetPropertyValue(OCPayloadType type, const char *prop, void **va { return OC_STACK_INVALID_PARAM; } + if (*value) + { + *value = NULL; + } OCStackResult res = OC_STACK_NO_RESOURCE; if (PAYLOAD_TYPE_DEVICE == type || PAYLOAD_TYPE_PLATFORM == type) { @@ -1608,7 +1612,7 @@ OCStackResult OCSetAttribute(OCResource* resource, const char* attribute, const // Fill in the new value. if (0 == strcmp(OC_RSRVD_DATA_MODEL_VERSION, attribute)) { - resAttrib->attrValue = CloneOCStringLL((OCStringLL *)value); + resAttrib->attrValue = OCCreateOCStringLL((char *)value); } else { diff --git a/resource/csdk/stack/test/stacktests.cpp b/resource/csdk/stack/test/stacktests.cpp index 9f7acfd..3b401c2 100644 --- a/resource/csdk/stack/test/stacktests.cpp +++ b/resource/csdk/stack/test/stacktests.cpp @@ -306,11 +306,12 @@ TEST(StackStart, SetPlatformInfoWithBadPlatformID) itst::DeadmanTimer killSwitch(SHORT_TEST_TIMEOUT); EXPECT_EQ(OC_STACK_OK, OCInit("127.0.0.1", 5683, OC_SERVER)); + char invalidId[] = "myDeviceUUID"; OCPlatformInfo info = { - "myDeviceUUID", - gManufacturerName, - 0, 0, 0, 0, 0, 0, 0, 0, 0 + invalidId, + gManufacturerName, + 0, 0, 0, 0, 0, 0, 0, 0, 0 }; EXPECT_EQ(OC_STACK_INVALID_PARAM, OCSetPlatformInfo(info)); @@ -512,10 +513,8 @@ TEST(StackStart, SetDeviceInfoAPI) EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, "Sample")); EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, "specVersion")); EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, "x.org.iotivity.newproperty", "value")); - OCStringLL *dataModelVersions = OCCreateOCStringLL("Data Model Version"); - EXPECT_TRUE(dataModelVersions != NULL); - EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, dataModelVersions)); - OCFreeOCStringLL(dataModelVersions); + EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + "Data Model Version")); OCResourceHandle handle = OCGetResourceHandleAtUri(OC_RSRVD_DEVICE_URI); EXPECT_TRUE(handle != NULL); EXPECT_EQ(OC_STACK_OK, OCBindResourceTypeToResource(handle, "oic.wk.tv")); @@ -531,10 +530,8 @@ TEST(StackStart, GetDeviceInfoAPI) EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, "Sample")); EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, "specVersion")); EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, "x.org.iotivity.newproperty", "value")); - OCStringLL *dataModelVersions = OCCreateOCStringLL("Data Model Version"); - EXPECT_TRUE(dataModelVersions != NULL); - EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, dataModelVersions)); - OCFreeOCStringLL(dataModelVersions); + EXPECT_EQ(OC_STACK_OK, OCSetPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + "Data Model Version")); OCResourceHandle handle = OCGetResourceHandleAtUri(OC_RSRVD_DEVICE_URI); EXPECT_TRUE(handle != NULL); EXPECT_EQ(OC_STACK_OK, OCBindResourceTypeToResource(handle, "oic.wk.tv")); diff --git a/resource/examples/simpleserver.cpp b/resource/examples/simpleserver.cpp index ae3897a..24aea45 100644 --- a/resource/examples/simpleserver.cpp +++ b/resource/examples/simpleserver.cpp @@ -508,13 +508,6 @@ void DeletePlatformInfo() delete[] platformInfo.systemTime; } -void DeleteDeviceInfo() -{ - delete[] deviceInfo.deviceName; - delete[] deviceInfo.specVersion; - OCFreeOCStringLL(deviceInfo.dataModelVersions); -} - void DuplicateString(char ** targetString, std::string sourceString) { *targetString = new char[sourceString.length() + 1]; @@ -542,23 +535,6 @@ OCStackResult SetPlatformInfo(std::string platformID, std::string manufacturerNa return OC_STACK_OK; } -OCStackResult SetDeviceInfo(std::string deviceName, std::string specVersion, std::string dataModelVersions) -{ - DuplicateString(&deviceInfo.deviceName, deviceName); - - if (!specVersion.empty()) - { - DuplicateString(&deviceInfo.specVersion, specVersion); - } - - if (!dataModelVersions.empty()) - { - OCResourcePayloadAddStringLL(&deviceInfo.dataModelVersions, dataModelVersions.c_str()); - } - - return OC_STACK_OK; -} - void * handleSlowResponse (void *param, std::shared_ptr pRequest) { // This function handles slow response case @@ -660,10 +636,15 @@ int main(int argc, char* argv[]) return -1; } - result = SetDeviceInfo(deviceName, specVersion, dataModelVersions); - OCResourcePayloadAddStringLL(&deviceInfo.types, "oic.wk.d"); - - result = OCPlatform::registerDeviceInfo(deviceInfo); + result = OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, deviceName); + result = OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, specVersion); + result = OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + dataModelVersions); + OCResourceHandle handle = OCGetResourceHandleAtUri(OC_RSRVD_DEVICE_URI); + if (handle) + { + OCBindResourceTypeToResource(handle, "oic.wk.tv"); + } if (result != OC_STACK_OK) { @@ -686,7 +667,6 @@ int main(int argc, char* argv[]) std::cout << "Added Interface and Type" << std::endl; DeletePlatformInfo(); - DeleteDeviceInfo(); // A condition variable will free the mutex it is given, then do a non- // intensive block until 'notify' is called on it. In this case, since we diff --git a/resource/include/IServerWrapper.h b/resource/include/IServerWrapper.h index 112ced6..8aee213 100644 --- a/resource/include/IServerWrapper.h +++ b/resource/include/IServerWrapper.h @@ -75,8 +75,12 @@ namespace OC virtual OCStackResult sendResponse(const std::shared_ptr pResponse) = 0; - virtual OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value) = 0; - virtual OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value) = 0; + virtual OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::string& value) = 0; + virtual OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::string& value) = 0; + virtual OCStackResult getPropertyList(OCPayloadType type, const std::string& tag, + std::vector& value) = 0; virtual OCStackResult stop() = 0; diff --git a/resource/include/InProcServerWrapper.h b/resource/include/InProcServerWrapper.h index e5dc0cd..98587d3 100644 --- a/resource/include/InProcServerWrapper.h +++ b/resource/include/InProcServerWrapper.h @@ -69,9 +69,12 @@ namespace OC virtual OCStackResult sendResponse(const std::shared_ptr pResponse); - virtual OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value); - virtual OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value); - + virtual OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::string& value); + virtual OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::string& value); + virtual OCStackResult getPropertyList(OCPayloadType type, const std::string& tag, + std::vector& value); virtual OCStackResult stop(); virtual OCStackResult start(); diff --git a/resource/include/OCPlatform.h b/resource/include/OCPlatform.h index ec8e3aa..1242036 100644 --- a/resource/include/OCPlatform.h +++ b/resource/include/OCPlatform.h @@ -196,10 +196,14 @@ namespace OC OCConnectivityType connectivityType, FindResListCallback resourceHandler, FindErrorCallback errorHandler, QualityOfService QoS = QualityOfService::LowQos); - OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value); - OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::vector& value); - OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value); - OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::vector& value); + OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::string& value); + OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::vector& value); + OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::string& value); + OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::vector& value); /** * API for Device Discovery * diff --git a/resource/include/OCPlatform_impl.h b/resource/include/OCPlatform_impl.h index 6b52693..6e0d9db 100644 --- a/resource/include/OCPlatform_impl.h +++ b/resource/include/OCPlatform_impl.h @@ -146,9 +146,14 @@ namespace OC OCStackResult getPlatformInfo(const std::string& host, const std::string& platformURI, FindPlatformCallback platformInfoHandler, QualityOfService QoS); - OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value); - OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::vector& value); - OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value); + OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::string& value); + OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::vector& value); + OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::string& value); + OCStackResult getPropertyList(OCPayloadType type, const std::string& tag, + std::vector& value); /** * This API registers a resource with the server diff --git a/resource/src/InProcServerWrapper.cpp b/resource/src/InProcServerWrapper.cpp index 391fc23..54f261d 100644 --- a/resource/src/InProcServerWrapper.cpp +++ b/resource/src/InProcServerWrapper.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include "logger.h" @@ -385,15 +386,44 @@ namespace OC return result; } - OCStackResult InProcServerWrapper::getPropertyValue(OCPayloadType type, const std::string& propName, - std::string& propValue) + OCStackResult InProcServerWrapper::getPropertyValue(OCPayloadType type, + const std::string& propName, std::string& propValue) { auto cLock = m_csdkLock.lock(); OCStackResult result = OC_STACK_ERROR; if (cLock) { std::lock_guard lock(*cLock); - result = OCGetPropertyValue(type, propName.c_str(), (void **)propValue.c_str()); + void *value = NULL; + result = OCGetPropertyValue(type, propName.c_str(), &value); + if (value && OC_STACK_OK == result) + { + propValue.assign((const char *)value); + OICFree(value); + } + } + return result; + } + + OCStackResult InProcServerWrapper::getPropertyList(OCPayloadType type, + const std::string& propName, std::vector& propValue) + { + auto cLock = m_csdkLock.lock(); + OCStackResult result = OC_STACK_ERROR; + void *value = NULL; + if (cLock) + { + std::lock_guard lock(*cLock); + result = OCGetPropertyValue(type, propName.c_str(), &value); + } + + if (OC_STACK_OK == result) + { + for (OCStringLL *tmp = (OCStringLL *)value; tmp; tmp = tmp->next) + { + propValue.push_back(tmp->value); + } + OCFreeOCStringLL((OCStringLL *)value); } return result; } diff --git a/resource/src/OCPlatform.cpp b/resource/src/OCPlatform.cpp index e05820b..80db44b 100644 --- a/resource/src/OCPlatform.cpp +++ b/resource/src/OCPlatform.cpp @@ -215,21 +215,30 @@ namespace OC return OCPlatform_impl::Instance().registerPlatformInfo(platformInfo); } - OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value) + OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::string& value) { return OCPlatform_impl::Instance().setPropertyValue(type, tag, value); } - OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::vector& value) + OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, + const std::vector& value) { return OCPlatform_impl::Instance().setPropertyValue(type, tag, value); } - OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value) + OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::string& value) { return OCPlatform_impl::Instance().getPropertyValue(type, tag, value); } + OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, + std::vector& value) + { + return OCPlatform_impl::Instance().getPropertyList(type, tag, value); + } + OCStackResult unregisterResource(const OCResourceHandle& resourceHandle) { return OCPlatform_impl::Instance().unregisterResource(resourceHandle); diff --git a/resource/src/OCPlatform_impl.cpp b/resource/src/OCPlatform_impl.cpp index 0180b7f..7f7d412 100644 --- a/resource/src/OCPlatform_impl.cpp +++ b/resource/src/OCPlatform_impl.cpp @@ -377,32 +377,43 @@ namespace OC return checked_guard(m_server, &IServerWrapper::registerPlatformInfo, platformInfo); } - OCStackResult OCPlatform_impl::setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value) + OCStackResult OCPlatform_impl::setPropertyValue(OCPayloadType type, const std::string& tag, + const std::string& value) { - return checked_guard(m_server, &IServerWrapper::setPropertyValue, type, tag, value); } - OCStackResult OCPlatform_impl::setPropertyValue(OCPayloadType type, const std::string& tag, const std::vector& value) + OCStackResult OCPlatform_impl::setPropertyValue(OCPayloadType type, const std::string& tag, + const std::vector& value) { + std::string concatString = ""; for (const auto& h : value) { - OCStackResult r; - - if (OC_STACK_OK != (r = result_guard(setPropertyValue(type, tag, h)))) - { - return r; - } + if (std::string::npos == h.find(",")) + { + concatString += h + ","; + } + else + { + return OC_STACK_INVALID_PARAM; + } } - return OC_STACK_OK; + return checked_guard(m_server, &IServerWrapper::setPropertyValue, type, tag, concatString); } - OCStackResult OCPlatform_impl::getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value) + OCStackResult OCPlatform_impl::getPropertyValue(OCPayloadType type, const std::string& tag, + std::string& value) { return checked_guard(m_server, &IServerWrapper::getPropertyValue, type, tag, value); } + OCStackResult OCPlatform_impl::getPropertyList(OCPayloadType type, const std::string& tag, + std::vector& value) + { + return checked_guard(m_server, &IServerWrapper::getPropertyList, type, tag, value); + } + OCStackResult OCPlatform_impl::registerResource(OCResourceHandle& resourceHandle, const std::shared_ptr< OCResource > resource) { diff --git a/resource/unittests/OCPlatformTest.cpp b/resource/unittests/OCPlatformTest.cpp index 415d9c9..05c497d 100644 --- a/resource/unittests/OCPlatformTest.cpp +++ b/resource/unittests/OCPlatformTest.cpp @@ -442,7 +442,7 @@ namespace OCPlatformTest BATCH_INTERFACE); EXPECT_EQ(OC_STACK_OK, result); } - + #if defined (_MSC_VER) TEST(BindInterfaceToResourceTest, DISABLED_BindZeroResourceInterface) #else @@ -463,7 +463,7 @@ namespace OCPlatformTest "core.brightlight"); EXPECT_EQ(OC_STACK_OK, result); } - + #if defined (_MSC_VER) TEST(BindTypeToResourceTest, DISABLED_BindZeroResourceType) #else @@ -817,6 +817,52 @@ namespace OCPlatformTest EXPECT_ANY_THROW(OCPlatform::registerDeviceInfo(di)); } + TEST(RegisterDeviceInfoTest, RegisterDeviceInfoWithSetPropertyValue) + { + std::string deviceName = "myDeviceName"; + EXPECT_EQ(OC_STACK_OK, OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, + deviceName)); + std::string specVersion = "mySpecVersion"; + EXPECT_EQ(OC_STACK_OK, OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, + specVersion)); + std::vector dmv; + dmv.push_back("myDataModelVersions"); + EXPECT_EQ(OC_STACK_OK, OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + dmv)); + OCResourceHandle handle = OCGetResourceHandleAtUri(OC_RSRVD_DEVICE_URI); + ASSERT_TRUE(NULL != handle); + EXPECT_EQ(OC_STACK_OK, OCBindResourceTypeToResource(handle, "oic.wk.tv")); + } + + + TEST(RegisterDeviceInfoTest, RegisterDeviceInfoWithGetPropertyValue) + { + EXPECT_EQ(OC_STACK_OK, OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, + "myDeviceName")); + EXPECT_EQ(OC_STACK_OK, OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, + "mySpecVersion")); + EXPECT_EQ(OC_STACK_OK, OCPlatform::setPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + "myDataModelVersions")); + OCResourceHandle handle = OCGetResourceHandleAtUri(OC_RSRVD_DEVICE_URI); + ASSERT_TRUE(NULL != handle); + EXPECT_EQ(OC_STACK_OK, OCBindResourceTypeToResource(handle, "oic.wk.tv")); + + std::string value; + EXPECT_EQ(OC_STACK_OK, OCPlatform::getPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DEVICE_NAME, + value)); + EXPECT_STREQ("myDeviceName", value.c_str()); + EXPECT_EQ(OC_STACK_OK, OCPlatform::getPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_SPEC_VERSION, + value)); + EXPECT_STREQ("mySpecVersion", value.c_str()); + std::vector dmv; + EXPECT_EQ(OC_STACK_OK, OCPlatform::getPropertyValue(PAYLOAD_TYPE_DEVICE, OC_RSRVD_DATA_MODEL_VERSION, + dmv)); + EXPECT_STREQ("myDataModelVersions", dmv[0].c_str()); + + EXPECT_STREQ("oic.wk.d", OCGetResourceTypeName(handle, 0)); + EXPECT_STREQ("oic.d.tv", OCGetResourceTypeName(handle, 1)); + EXPECT_STREQ("oic.wk.tv", OCGetResourceTypeName(handle, 2)); + } //SubscribePresence Test TEST(SubscribePresenceTest, DISABLED_SubscribePresenceWithValidParameters) { -- 2.7.4