From aa489716070442064ed104422be5b43ac6ea7204 Mon Sep 17 00:00:00 2001 From: Rami Jung Date: Thu, 30 Jul 2015 13:09:51 +0900 Subject: [PATCH] [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 --- .../src/serverBuilder/unittests/RCSResourceObjectTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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&) { -- 2.7.4