Fixed tests in resource-encapsulation by using move ctor
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Thu, 3 Mar 2016 17:25:47 +0000 (18:25 +0100)
committerUze Choi <uzchoi@samsung.com>
Sun, 6 Mar 2016 08:32:23 +0000 (08:32 +0000)
commitbc20c400a5da5b7ec28fbf1a7f73efa3b6016e77
tree6c956238ac0a16dfe2d9c66bb9fe940beaf88651
parent64c4d5f0b6f67aceda9ab49ad947b9468a34672c
Fixed tests in resource-encapsulation by using move ctor

DiscoveryTaskPtr is a unique_ptr, therefore it is a move-only object,
which is why ScopeTask's copy constructor is deleted.

This change Fix FTBFS by declaring move constructor (C++11 &&) in Task class
and also use it also in instance declaration to avoid copies.

Issue appeared with g++-4.9.2 on Tizen:Common and probably other setup

Reported error message is in this form :

  service/resource-encapsulation/unittests/DiscoveryManagerTest.cpp: \
  In member function 'virtual void DiscoveryManagerTest_CallbackWouldNotBeCalledForSameRemoteResource_Test::TestBody()':

  service/resource-encapsulation/unittests/DiscoveryManagerTest.cpp:139:33: \
  error: use of deleted function 'ScopedTask::ScopedTask(const ScopedTask&)'
             onResourceDiscovered);
                                 ^

Change-Id: I0fe6d5c4037ddf90e83185d96f99c9378c56caa7
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5361
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-encapsulation/unittests/DiscoveryManagerTest.cpp