]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
unit tests for sharedptr_registry
authorLoic Dachary <loic@dachary.org>
Tue, 9 Jul 2013 07:40:13 +0000 (09:40 +0200)
committerSamuel Just <sam.just@inktank.com>
Fri, 19 Sep 2014 22:57:48 +0000 (15:57 -0700)
commitd236a93b5f0283012134b8cc100741162c548cb0
treefa7c4c65c414ad0bcce8d1617f8aad5d7c92762e
parent3f020443c8d92e61d8593049147a79a6696c9c93
unit tests for sharedptr_registry

Covers 100% of the LOC and all the expected behavior, including thread
safety.

The sharedptr_registry is made friend of the test class so that it can
synthetize race conditions. The lookup and lookup_or_create methods
set the new in_method data member before calling cond.Wait() so that
the caller knows it is waiting.

http://tracker.ceph.com/issues/5527 refs #5527

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 6b16cd1aaaf818db0a6063f3a3ebb02eeefa3056)
src/Makefile.am
src/common/sharedptr_registry.hpp
src/test/common/test_sharedptr_registry.cc [new file with mode: 0644]