From: Rami Jung Date: Thu, 30 Jul 2015 04:09:51 +0000 (+0900) Subject: [Resource-Encapsulation] compaction by reusing the definition of 'constexpr char... X-Git-Tag: 1.2.0+RC1~1308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa489716070442064ed104422be5b43ac6ea7204;p=platform%2Fupstream%2Fiotivity.git [Resource-Encapsulation] compaction by reusing the definition of 'constexpr char KEY[]' Change-Id: Ibfd7ad1cbf82652c6e30c584be5e0a920b44a228 Signed-off-by: Rami Jung Reviewed-on: https://gerrit.iotivity.org/gerrit/1985 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- diff --git a/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp b/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp index fadaa83..64b0fd7 100755 --- a/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp +++ b/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp @@ -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&) {