proxygen
|
#include <folly/concurrency/ConcurrentHashMap.h>
#include <atomic>
#include <memory>
#include <thread>
#include <folly/hash/Hash.h>
#include <folly/portability/GTest.h>
#include <folly/test/DeterministicSchedule.h>
Go to the source code of this file.
Classes | |
struct | foo |
struct | Wrapper |
Macros | |
#define | Atom std::atomic |
#define | Mutex std::mutex |
#define | lib std |
#define | join t.join() |
#define Atom std::atomic |
Definition at line 301 of file ConcurrentHashMapTest.cpp.
Referenced by folly::hazptr_domain< DeterministicAtomic >::acquire_new_hprec(), array_dtor_full_tc_test(), array_test(), folly::detail::atomic_notification::atomic_notify_all_impl(), folly::test::atomic_notify_one(), folly::detail::atomic_notification::atomic_notify_one_impl(), folly::detail::atomic_notification::atomic_wait_impl(), folly::detail::atomic_notification::atomic_wait_until_impl(), auto_retire_test(), basic_holders_test(), basic_objects_test(), basic_protection_test(), burn(), cleanup_test(), copy_and_move_test(), folly::detail::LifoSemBase< BatonType, Atom >::decrOrPush(), folly::default_hazptr_domain(), folly::hazptr_deleter< T, std::default_delete< T > >::delete_obj(), destruction_test(), deterministicAtomicWaitUntilTests(), folly::hazptr_obj_linked< Atom >::downgrade_link(), folly::test::doWork(), free_function_retire_test(), folly::hazptr_default_domain_helper< std::atomic >::get(), counted_ptr_base< Atom >::getRef(), folly::detail::LifoSemNode< Handoff, Atom >::handoff(), folly::hazptr_domain_push_retired(), folly::detail::hazptr_domain_rcount_threshold(), folly::hazptr_retire(), folly::AccessSpreader< Atom >::initialize(), non_atomic< T >::is_lock_free(), lifo_test(), linked_test(), local_test(), make_counted(), folly::MPMCQueue< T, Atom, true >::maybeUpdateFromClosed(), move_test(), mt_linked_test(), folly::detail::LifoSemHead::operator!=(), folly::hazptr_root< Node, Atom >::operator()(), folly::DefaultWeightFn< T >::operator()(), counted_ptr< T, Atom >::operator==(), folly::hazptr_array< 3, Atom >::operator[](), folly::hazptr_obj< Atom >::pre_retire_check_fail(), priv_dtor_test(), List< T, Atom >::protect_all(), pthrd_mutex_(), pthrd_rwlock_reads(), Node< Atom >::ptr_next(), NodeRC< Mutable, Atom >::push_links(), NodeAuto< Atom >::push_links(), folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::push_links(), run_basic_test(), folly::test::run_basic_test(), run_basic_tests(), run_basic_thread(), folly::test::run_basic_timed_wait_tests(), run_mt_sequencer_thread(), folly::test::run_pingpong_test(), run_pingpong_test(), run_steady_clock_test(), folly::test::run_timed_wait_tmo_tests(), runNeverFailTest(), runNeverFailThread(), runNeverFailUntilThread(), folly::runReader(), runRemoteUnlock(), runTryEnqDeqThread(), folly::hazptr_holder< Atom >::set_hprec(), folly::swap(), swmr_test(), folly::TEST(), TEST(), folly::detail::atomic_notification::toCvStatus(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::tryUnlockTokenlessSharedDeferred(), folly::LockFreeRingBuffer< T, Atom >::turn(), PosixMutex::unlock_shared(), folly::value(), virtual_test(), and folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::zeroFillSlots().
#define join t.join() |
Definition at line 304 of file ConcurrentHashMapTest.cpp.
Referenced by release_docs.WikiBrancher::__init__(), fbcode_builder.FBCodeBuilder::__repr__(), cpp.ast.Parameter::__str__(), cpp.ast.Type::__str__(), upload.SubversionVCS::_CollapseKeywords(), cpp.gmock_class::_GenerateMethods(), cpp.gmock_class::_GenerateMocks(), cpp.ast.AstBuilder::_GenerateOne(), cpp.ast.AstBuilder::_GetClass(), upload.HttpRpcServer::_GetOpener(), cpp.ast._GenericDeclaration::_TypeStringHelper(), pump.Output::Append(), pump::BeautifyCode(), pump.Token::Clone(), cpp.ast.TypeConverter::DeclarationToParts(), cpp.ast._GenericDeclaration::FullName(), gen_trace_event_constants::gen_java(), upload.GitVCS::GenerateDiff(), upload.MercurialVCS::GenerateDiff(), gen_gtest_pred_impl::GenerateHeader(), cpp.gmock_class_test.GenerateMethodsTest::GenerateMethodSource(), cpp.gmock_class_test.GenerateMocksTest::GenerateMocks(), gen_gtest_pred_impl::GenerateUnitTest(), upload.MercurialVCS::GetBaseFile(), cpp.ast.AstBuilder::handle_struct(), upload_gtest::main(), upload_gmock::main(), cpp.gmock_class::main(), make_docker_context::make_docker_context(), wangle::MultiFilePoller::registerFiles(), gtest_throw_on_failure_test::Run(), gtest_throw_on_failure_test.ThrowOnFailureTest::RunAndVerify(), gtest_break_on_failure_unittest.GTestBreakOnFailureUnitTest::RunAndVerify(), gtest_list_tests_unittest.GTestListTestsUnitTest::RunAndVerify(), upload::RunShellWithReturnCode(), folly::runWritesNeverFail(), upload::SplitPatch(), cpp.gmock_class_test.TestCase::StripLeadingWhitespace(), pump::SubString(), TEST(), TEST_F(), gtest_output_test.GTestOutputTest::testOutput(), gen_gtest_pred_impl::TestsForArity(), and cpp.ast.TypeConverter::ToType().
#define lib std |
Definition at line 303 of file ConcurrentHashMapTest.cpp.
Referenced by cmake_minimum_required(), option(), and TEST().
#define Mutex std::mutex |
Definition at line 302 of file ConcurrentHashMapTest.cpp.
Referenced by burn(), testing::internal::CheckedDowncastToActualType(), folly::test::doWork(), doWork(), runUncontended(), TEST(), folly::sync_tests::testAcquireLocked(), folly::sync_tests::testAcquireLockedWithConst(), folly::sync_tests::testBasicImpl(), folly::sync_tests::testConcurrency(), folly::sync_tests::testConstCopy(), folly::sync_tests::testDeprecated(), folly::sync_tests::testDualLocking(), folly::sync_tests::testDualLockingWithConst(), folly::sync_tests::testExchange(), folly::sync_tests::testTimed(), folly::sync_tests::testTimedShared(), folly::sync_tests::testTimedSynchronized(), folly::sync_tests::testTimedSynchronizedWithConst(), folly::sync_tests::testWithLock(), and folly::wlock().
TEST | ( | ConcurrentHashMap | , |
MapTest | |||
) |
Definition at line 33 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign_if_equal(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::at(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::clear(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::empty(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), EXPECT_EQ, EXPECT_FALSE, EXPECT_NE, EXPECT_TRUE, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::max_load_factor().
TEST | ( | ConcurrentHashMap | , |
MaxSizeTest | |||
) |
Definition at line 72 of file ConcurrentHashMapTest.cpp.
References EXPECT_TRUE, i, and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().
TEST | ( | ConcurrentHashMap | , |
MoveTest | |||
) |
Definition at line 84 of file ConcurrentHashMapTest.cpp.
References folly::gen::move.
TEST | ( | ConcurrentHashMap | , |
EmplaceTest | |||
) |
Definition at line 113 of file ConcurrentHashMapTest.cpp.
References bar, foo::copied, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::emplace(), EXPECT_EQ, folly::foo, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), foo::moved, and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace().
TEST | ( | ConcurrentHashMap | , |
MapResizeTest | |||
) |
Definition at line 130 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), EXPECT_EQ, EXPECT_FALSE, EXPECT_NE, EXPECT_TRUE, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::reserve().
TEST | ( | ConcurrentHashMap | , |
MapNoCopiesTest | |||
) |
Definition at line 151 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), EXPECT_EQ, EXPECT_NE, EXPECT_TRUE, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), i, folly::test::operator==(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace().
TEST | ( | ConcurrentHashMap | , |
MapMovableKeysTest | |||
) |
Definition at line 180 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign_if_equal(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::emplace(), EXPECT_FALSE, EXPECT_TRUE, i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign(), folly::test::operator==(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::try_emplace().
TEST | ( | ConcurrentHashMap | , |
MapUpdateTest | |||
) |
Definition at line 211 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::assign(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), EXPECT_EQ, EXPECT_NE, EXPECT_TRUE, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().
TEST | ( | ConcurrentHashMap | , |
MapIterateTest2 | |||
) |
Definition at line 220 of file ConcurrentHashMapTest.cpp.
References folly::test::begin(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cbegin(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), folly::test::end(), and EXPECT_EQ.
TEST | ( | ConcurrentHashMap | , |
MapIterateTest | |||
) |
Definition at line 227 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cbegin(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), count, EXPECT_EQ, EXPECT_NE, EXPECT_TRUE, and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().
TEST | ( | ConcurrentHashMap | , |
MoveIterateAssignIterate | |||
) |
Definition at line 250 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), map(), and folly::gen::move.
TEST | ( | ConcurrentHashMap | , |
EraseTest | |||
) |
Definition at line 263 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), EXPECT_EQ, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().
TEST | ( | ConcurrentHashMap | , |
CopyIterator | |||
) |
Definition at line 271 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cbegin(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), EXPECT_EQ, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
EraseInIterateTest | |||
) |
Definition at line 280 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cbegin(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), EXPECT_EQ, EXPECT_GE, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), k, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::size(), and uint64_t.
TEST | ( | ConcurrentHashMap | , |
UpdateStressTest | |||
) |
Definition at line 310 of file ConcurrentHashMapTest.cpp.
References Atom, EXPECT_EQ, EXPECT_NE, EXPECT_TRUE, i, folly::hash::jenkins_rev_mix32(), folly::join(), k, m, Mutex, folly::size(), folly::pushmi::detail::t, threads, uint32_t, folly::test::DeterministicSchedule::uniform(), and val.
TEST | ( | ConcurrentHashMap | , |
EraseStressTest | |||
) |
Definition at line 362 of file ConcurrentHashMapTest.cpp.
References Atom, EXPECT_EQ, EXPECT_TRUE, i, folly::hash::jenkins_rev_mix32(), folly::join(), k, m, Mutex, folly::size(), folly::pushmi::detail::t, threads, uint32_t, and folly::test::DeterministicSchedule::uniform().
TEST | ( | ConcurrentHashMap | , |
IterateStressTest | |||
) |
Definition at line 421 of file ConcurrentHashMapTest.cpp.
References Atom, count, EXPECT_EQ, EXPECT_TRUE, i, folly::hash::jenkins_rev_mix32(), folly::join(), k, m, Mutex, folly::size(), folly::pushmi::detail::t, threads, uint32_t, and folly::test::DeterministicSchedule::uniform().
TEST | ( | ConcurrentHashMap | , |
insertStressTest | |||
) |
Definition at line 476 of file ConcurrentHashMapTest.cpp.
References Atom, EXPECT_FALSE, EXPECT_TRUE, i, folly::join(), m, Mutex, folly::size(), folly::pushmi::detail::t, threads, uint32_t, and folly::test::DeterministicSchedule::uniform().
TEST | ( | ConcurrentHashMap | , |
assignStressTest | |||
) |
Definition at line 511 of file ConcurrentHashMapTest.cpp.
References a, Atom, b, check(), EXPECT_EQ, EXPECT_NE, i, folly::join(), m, Mutex, folly::size(), folly::pushmi::detail::t, threads, uint32_t, uint64_t, folly::test::DeterministicSchedule::uniform(), and v.
TEST | ( | ConcurrentHashMap | , |
RefcountTest | |||
) |
Definition at line 575 of file ConcurrentHashMapTest.cpp.
References i, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign(), int32_t, and uint64_t.
TEST | ( | ConcurrentHashMap | , |
Deletion | |||
) |
Definition at line 606 of file ConcurrentHashMapTest.cpp.
References EXPECT_TRUE, folly::hazptr_cleanup(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
DeletionWithErase | |||
) |
Definition at line 620 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), EXPECT_TRUE, folly::hazptr_cleanup(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
DeletionWithIterator | |||
) |
Definition at line 635 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::erase(), EXPECT_TRUE, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::find(), folly::hazptr_cleanup(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
DeletionWithForLoop | |||
) |
Definition at line 651 of file ConcurrentHashMapTest.cpp.
References folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cbegin(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::cend(), EXPECT_EQ, EXPECT_TRUE, folly::hazptr_cleanup(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
DeletionMultiple | |||
) |
Definition at line 668 of file ConcurrentHashMapTest.cpp.
References EXPECT_TRUE, folly::hazptr_cleanup(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
DeletionAssigned | |||
) |
Definition at line 684 of file ConcurrentHashMapTest.cpp.
References EXPECT_TRUE, folly::hazptr_cleanup(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert_or_assign(), and map().
TEST | ( | ConcurrentHashMap | , |
DeletionMultipleMaps | |||
) |
Definition at line 700 of file ConcurrentHashMapTest.cpp.
References EXPECT_TRUE, folly::hazptr_cleanup(), and folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert().
TEST | ( | ConcurrentHashMap | , |
ForEachLoop | |||
) |
Definition at line 717 of file ConcurrentHashMapTest.cpp.
References EXPECT_EQ, folly::ConcurrentHashMap< KeyType, ValueType, HashFn, KeyEqual, Allocator, ShardBits, Atom, Mutex >::insert(), and map().
TEST | ( | ConcurrentHashMap | , |
IteratorMove | |||
) |
Definition at line 729 of file ConcurrentHashMapTest.cpp.
References ASSERT_EQ, folly::foo, foo2(), gen_gtest_pred_impl::Iter(), k, map(), and folly::gen::move.