Fixed failed tests of RE cache module. 09/7709/2
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 8 Apr 2016 01:33:15 +0000 (18:33 -0700)
committerUze Choi <uzchoi@samsung.com>
Fri, 8 Apr 2016 07:57:35 +0000 (07:57 +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>
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;});
         }