]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_sharedptr_registry.cc: reduce scope of local variable
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 22 Oct 2014 08:50:15 +0000 (10:50 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 26 Oct 2014 17:10:14 +0000 (18:10 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/common/test_sharedptr_registry.cc

index 6121b6335b8d39afa1d12111cb20f2e34b6bcf15..9c9e89f9cf78b3e7094827a765ab881278146131 100644 (file)
@@ -174,9 +174,9 @@ TEST_F(SharedPtrRegistry_all, wait_lookup_or_create) {
 TEST_F(SharedPtrRegistry_all, lookup) {
   SharedPtrRegistryTest registry;
   unsigned int key = 1;
-  int value = 2;
   {
     shared_ptr<int> ptr = registry.lookup_or_create(key);
+    int value = 2;
     *ptr = value;
     ASSERT_EQ(value, *registry.lookup(key));
   }