void setRemoteAttributesCallback(const RCSResourceAttributes&, int) {}
void setRemoteRepresentationCallback(const HeaderOpts&, const RCSRepresentation&, int) {}
void resourceStateChanged(ResourceState) { }
-void cacheUpdatedCallback(const RCSResourceAttributes&) {}
+void cacheUpdatedCallback(const RCSResourceAttributes&, int) {}
class RemoteResourceObjectTest: public TestWithMock
{
TEST_F(RemoteResourceObjectTest, CacheStateIsReadyAfterCacheUpdated)
{
mocks.ExpectCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
object->startCaching(cacheUpdatedCallback);
Wait();
TEST_F(RemoteResourceObjectTest, IsCachedAvailableReturnsTrueWhenCacheIsReady)
{
mocks.ExpectCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
object->startCaching(cacheUpdatedCallback);
Wait();
TEST_F(RemoteResourceObjectTest, DISABLED_CacheUpdatedCallbackBeCalledWheneverCacheUpdated)
{
mocks.OnCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
object->startCaching(cacheUpdatedCallback);
Wait();
mocks.ExpectCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
server->setAttribute(ATTR_KEY, ATTR_VALUE + 1);
constexpr int newValue = ATTR_VALUE + 1;
mocks.OnCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
object->startCaching(cacheUpdatedCallback);
Wait();
mocks.ExpectCallFunc(cacheUpdatedCallback).
- Match([this](const RCSResourceAttributes& attrs){
+ Match([this](const RCSResourceAttributes& attrs, int){
return attrs.at(ATTR_KEY) == newValue;
}).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
server->setAttribute(ATTR_KEY, newValue);
TEST_F(RemoteResourceObjectTest, CachedAttributesHasSameAttributesWithServer)
{
mocks.OnCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
object->startCaching(cacheUpdatedCallback);
Wait();
TEST_F(RemoteResourceObjectTest, GetCachedAttributeThrowsIfKeyIsInvalid)
{
mocks.OnCallFunc(cacheUpdatedCallback).
- Do([this](const RCSResourceAttributes&){ Proceed(); });
+ Do([this](const RCSResourceAttributes&, int){ Proceed(); });
object->startCaching(cacheUpdatedCallback);
Wait();