From: Danny Al-Gaaf Date: Wed, 22 Oct 2014 08:49:33 +0000 (+0200) Subject: test_shared_cache.cc: reduce scope of local variable X-Git-Tag: v0.88~22^2~27 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f2340aa5ca19617c5123f9ac2b5dc0caab7989c4;p=ceph.git test_shared_cache.cc: reduce scope of local variable Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/common/test_shared_cache.cc b/src/test/common/test_shared_cache.cc index c56641d0cffc0..2cfd8439b46f7 100644 --- a/src/test/common/test_shared_cache.cc +++ b/src/test/common/test_shared_cache.cc @@ -103,7 +103,6 @@ TEST_F(SharedLRU_all, add) { SharedLRUTest cache; unsigned int key = 1; int value1 = 2; - int value2 = 3; bool existed = false; { shared_ptr ptr = cache.add(key, new int(value1), &existed); @@ -111,6 +110,7 @@ TEST_F(SharedLRU_all, add) { ASSERT_FALSE(existed); } { + int value2 = 3; shared_ptr ptr = cache.add(key, new int(value2), &existed); ASSERT_EQ(value1, *ptr); ASSERT_TRUE(existed); @@ -120,8 +120,8 @@ TEST_F(SharedLRU_all, add) { TEST_F(SharedLRU_all, lookup) { SharedLRUTest cache; unsigned int key = 1; - int value = 2; { + int value = 2; ASSERT_TRUE(cache.add(key, new int(value))); ASSERT_TRUE(cache.lookup(key)); ASSERT_EQ(value, *cache.lookup(key));