expanding the coverage of testing RCSResourceObject.cpp
authorRami Jung <rami.jung@samsung.com>
Mon, 27 Jul 2015 11:51:28 +0000 (20:51 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 27 Jul 2015 16:56:35 +0000 (16:56 +0000)
It calls both
addAttributeUpdatedListener(const std::string& key,AttributeUpdatedListener h)
addAttributeUpdatedListener(const std::string&& key,AttributeUpdatedListener h)

Change-Id: Ic46f85104fb4887515af9745b3dc11b3d90b9516
Signed-off-by: Rami Jung <rami.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1938
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp

index 5161125..fadaa83 100755 (executable)
@@ -609,18 +609,19 @@ TEST_F(AttributeUpdatedListenerTest, AddListenerReturnsTrueIfListenerIsCalled)
 TEST_F(AttributeUpdatedListenerTest, AddListenerisChangedAccordingToLastAddedFunction)
 {
     int called=0, expected=100;
+    const char Key[]={"newKey"};
 
-    server->setAttribute(KEY,0);
+    server->setAttribute(Key,0);
     OCRepresentation ocRep = createOCRepresentation();
 
-    server->addAttributeUpdatedListener("key",
+    server->addAttributeUpdatedListener(Key,
         [&called](const OIC::Service::RCSResourceAttributes::Value&,
         const OIC::Service::RCSResourceAttributes::Value&)
         {
             called=10;
         } );
 
-    server->addAttributeUpdatedListener(KEY,
+    server->addAttributeUpdatedListener("newKey",
         [&called](const OIC::Service::RCSResourceAttributes::Value&,
         const OIC::Service::RCSResourceAttributes::Value&)
         {