Clean up warning
authorGeorge Nash <george.nash@intel.com>
Tue, 12 Apr 2016 17:47:08 +0000 (10:47 -0700)
committerJon A. Cruz <jon@joncruz.org>
Fri, 22 Apr 2016 05:40:45 +0000 (05:40 +0000)
This cleans up the warning capture of variable with non-automatic
storage duration

The warning is given when lambda functions are trying to capture
variables that are static or global. The easy fix is to not
capture the variables. They will still be avalible to the lamba
function without the variable capture.

Change-Id: I00890ddf5cf6932d1114ff4ca305905b4b877cc6
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7761
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
service/resource-hosting/unittest/HostingObjectUnitTest.cpp
service/resource-hosting/unittest/ResourceHostingUnitTest.cpp

index b56a4cf..2f83458 100755 (executable)
@@ -134,7 +134,7 @@ TEST_F(HostingObjectTest, createMirroredServer)
 
     waitForCondition(waitForResponse);
     mocks.OnCallFunc(onDiscoveryResource).Do(
-            [this, &uri, &discoveryTask, &testObject, &discoveredResource]
+            [this, &uri, &discoveryTask]
              (RCSRemoteResourceObject::Ptr ptr)
             {
                 if(ptr->getUri() == testObject.getHostedServerUri())
@@ -203,7 +203,7 @@ TEST_F(HostingObjectTest, ExpectCallOnDestroyWhenStopHostingObject)
     int waitForResponse = 1000;
 
     mocks.ExpectCallFunc(onDestroy).Do(
-            [& responseCon]()
+            []()
             {
                 responseCon.notify_all();
             });
index 79b1d1d..e476b6d 100755 (executable)
@@ -106,7 +106,7 @@ TEST_F(ResourceHostingTest, HostingFoundBeforeMakeOriginServer)
     waitForCondition();
 
     mocks.OnCallFunc(onDiscoveryResource).Do(
-            [this, &uri, &testObject](RCSRemoteResourceObject::Ptr ptr)
+            [this, &uri](RCSRemoteResourceObject::Ptr ptr)
             {
                 if(ptr->getUri() == testObject.getHostedServerUri())
                 {