Fixed failed tests of RE cache module.
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 8 Apr 2016 01:33:15 +0000 (18:33 -0700)
committerUze Choi <uzchoi@samsung.com>
Mon, 11 Apr 2016 13:10:33 +0000 (13:10 +0000)
The cause was calling a method not mocked.

Change-Id: I74e20d34d793085e9888f634bb1a5e060f09e0ee
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7709
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 4fa510cdc72a7412fcae654d031b7d3bff9b1800)
Reviewed-on: https://gerrit.iotivity.org/gerrit/7725

service/resource-encapsulation/src/resourceCache/unittests/DataCacheTest.cpp
service/resource-encapsulation/src/resourceCache/unittests/ResourceCacheTest.cpp

index ec7cd1c..41029b7 100644 (file)
@@ -51,6 +51,8 @@ class DataCacheTest : public TestWithMock
         {
             TestWithMock::SetUp();
             pResource = PrimitiveResource::Ptr(mocks.Mock< PrimitiveResource >(), [](PrimitiveResource *) {});
+
+            mocks.OnCall(pResource.get(), PrimitiveResource::isObservable).Return(false);
             cacheHandler.reset(new DataCache());
             cb = ([](std::shared_ptr<PrimitiveResource >, const RCSResourceAttributes &)->OCStackResult {return OC_STACK_OK;});
         }
index 14f3f40..5bf9f74 100644 (file)
@@ -41,6 +41,7 @@ class ResourceCacheManagerTest : public TestWithMock
             TestWithMock::SetUp();
             cacheInstance = ResourceCacheManager::getInstance();
             pResource = PrimitiveResource::Ptr(mocks.Mock< PrimitiveResource >(), [](PrimitiveResource *) {});
+            mocks.OnCall(pResource.get(), PrimitiveResource::isObservable).Return(false);
             cb = ([](std::shared_ptr<PrimitiveResource >, const RCSResourceAttributes &)->OCStackResult {return OC_STACK_OK;});
         }