[Resource-Encapsulation] compaction by reusing the definition of 'constexpr char...
authorRami Jung <rami.jung@samsung.com>
Thu, 30 Jul 2015 04:09:51 +0000 (13:09 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Fri, 31 Jul 2015 08:00:44 +0000 (08:00 +0000)
Change-Id: Ibfd7ad1cbf82652c6e30c584be5e0a920b44a228
Signed-off-by: Rami Jung <rami.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1985
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp

index fadaa83..64b0fd7 100755 (executable)
@@ -609,19 +609,19 @@ TEST_F(AttributeUpdatedListenerTest, AddListenerReturnsTrueIfListenerIsCalled)
 TEST_F(AttributeUpdatedListenerTest, AddListenerisChangedAccordingToLastAddedFunction)
 {
     int called=0, expected=100;
-    const char Key[]={"newKey"};
+    string myKey("key");  // 'myKey' and 'constexpr char KEY[]' should have same value
 
-    server->setAttribute(Key,0);
+    server->setAttribute(KEY,0);
     OCRepresentation ocRep = createOCRepresentation();
 
-    server->addAttributeUpdatedListener(Key,
+    server->addAttributeUpdatedListener(myKey,
         [&called](const OIC::Service::RCSResourceAttributes::Value&,
         const OIC::Service::RCSResourceAttributes::Value&)
         {
             called=10;
         } );
 
-    server->addAttributeUpdatedListener("newKey",
+    server->addAttributeUpdatedListener(KEY,
         [&called](const OIC::Service::RCSResourceAttributes::Value&,
         const OIC::Service::RCSResourceAttributes::Value&)
         {