22 using namespace folly;
84 for (
int i = 0;
i < 100;
i++) {
88 for (
int i = 0;
i < 100;
i++) {
99 for (
int i = 0;
i < 100;
i++) {
103 for (
int i = 0;
i < 100;
i++) {
114 for (
int i = 0;
i < 100;
i++) {
118 for (
int i = 0;
i < 100;
i++) {
129 for (
int i = 0;
i < 99;
i++) {
138 for (
int i = 0;
i < 100;
i++) {
142 for (
int i = 0;
i < 100;
i++) {
153 for (
int i = 0;
i < 90;
i++) {
156 for (
int i = 90;
i < 100;
i++) {
166 for (
int i = 0;
i < 100;
i++) {
171 auto pruneCb = [&](
int&&
k,
int&&
v) {
178 for (
int i = 0;
i < 100;
i++) {
189 for (
int i = 0;
i < 100;
i++) {
195 for (
int i = 0;
i < 100;
i++) {
206 for (
int i = 0;
i < 100;
i++) {
212 for (
int i = 0;
i < 100;
i++) {
223 for (
int i = 0;
i < 99;
i++) {
235 for (
int i = 0;
i < 100;
i++) {
242 for (
int i = 0;
i < 100;
i++) {
253 for (
int i = 0;
i < 90;
i++) {
256 for (
int i = 90;
i < 100;
i++) {
266 for (
int i = 0;
i < 90;
i++) {
275 for (
int i = 0;
i < 90;
i++) {
288 for (
int i = 0;
i < 90;
i++) {
298 for (
int i = 0;
i < 90;
i++) {
311 SumInt(
int val_,
int* ref_) :
val(val_), ref(ref_) {}
324 for (
int i = 0;
i < 100;
i++) {
328 for (
int i = 0;
i < 100;
i++) {
329 map.
set(
i, SumInt(
i, &sum));
340 for (
int i = 0;
i < 100;
i++) {
345 for (
int i = 0;
i < 100;
i++) {
346 map.
set(
i, SumInt(
i, &sum));
357 for (
int i = 0;
i < 100;
i++) {
362 for (
int i = 0;
i < 100;
i++) {
363 map.
set(
i, SumInt(
i, &sum));
374 for (
int i = 0;
i < 99;
i++) {
386 for (
int i = 0;
i < 100;
i++) {
391 for (
int i = 0;
i < 100;
i++) {
392 map.
set(
i, SumInt(
i, &sum));
403 for (
int i = 0;
i < 90;
i++) {
406 for (
int i = 90;
i < 100;
i++) {
418 for (
int i = 0;
i < 100;
i++) {
422 for (
int i = 0;
i < 100;
i++) {
432 for (
int i = 0;
i < 90;
i++) {
435 for (
int i = 90;
i < 100;
i++) {
444 for (
int i = 0;
i < 100;
i++) {
448 for (
int i = 0;
i < 100;
i++) {
454 for (
int j = 0; j <
std::min(
i + 1, 9); j++) {
462 for (
int i = 0;
i < 9;
i++) {
466 for (
int i = 10;
i < 99;
i++) {
475 for (
int i = 0;
i < 100;
i++) {
479 for (
int i = 0;
i < 100;
i++) {
485 for (
int j = 0; j <
std::min(
i + 1, 9); j++) {
494 for (
int i = 0;
i < 90;
i++) {
497 for (
int i = 90;
i < 100;
i++) {
503 const int nItems = 1000;
506 for (
int i = 0;
i < nItems;
i++) {
514 for (
auto& it : map) {
516 seen.insert(it.first);
523 const int nItems = 1000;
525 for (
int i = 0;
i < nItems;
i++) {
526 map.
set(
i * 2,
i * 2);
530 for (
int i = 0;
i < nItems * 2;
i++) {
532 auto it = map.
find(
i);
540 for (
int i = nItems * 2 - 1;
i >= 0;
i--) {
542 auto it = map.
find(
i);
554 const int nItems = 1000;
556 for (
int i = 0;
i < nItems;
i++) {
557 map.
set(
i * 2,
i * 2);
561 for (
int i = nItems * 2 - 1;
i >= 0;
i--) {
575 const int nItems = 1000;
577 for (
int i = 0;
i < nItems;
i++) {
583 int expected = nItems - 1;
584 for (
auto it = map.
begin(); it != map.
end(); ++it) {
590 for (
auto it = map.
rbegin(); it != map.
rend(); ++it) {
603 }
while (it != map.
begin());
608 auto it = map.
rend();
609 expected = nItems - 1;
614 }
while (it != map.
rbegin());
620 const int nItems = 1000;
622 for (
int i = 0;
i < nItems;
i++) {
630 for (
int i = 0;
i < nItems;
i++) {
637 const int nItems = 100;
639 bool operator()(
const int&
a,
const int&
b)
const {
640 return (a % mod) == (b % mod);
645 size_t operator()(
const int&
a)
const {
646 return std::hash<int>()(a % mod);
651 nItems, 1 ,
Hash{nItems},
Eq{nItems});
652 for (
int i = 0;
i < nItems;
i++) {
std::atomic< int64_t > sum(0)
bool exists(const TKey &key) const
internal::EqMatcher< T > Eq(T x)
#define EXPECT_EQ(val1, val2)
void set(const TKey &key, TValue value, bool promote=true, PruneHookCall pruneHook=nullptr)
constexpr detail::Map< Move > move
TValue & get(const TKey &key)
bool erase(const TKey &key)
—— Concurrent Priority Queue Implementation ——
#define EXPECT_GE(val1, val2)
std::unordered_set< std::pair< const IValidator *, const dynamic * > > seen
const_iterator findWithoutPromotion(const TKey &key) const
void setMaxSize(size_t maxSize, PruneHookCall pruneHook=nullptr)
#define EXPECT_TRUE(condition)
iterator find(const TKey &key)
void prune(std::size_t pruneSize, PruneHookCall pruneHook=nullptr)
#define EXPECT_FALSE(condition)
reverse_iterator rbegin()
void setClearSize(size_t clearSize)
const TValue & getWithoutPromotion(const TKey &key) const
TEST(SequencedExecutor, CPUThreadPoolExecutor)
void setPruneHook(PruneHookCall pruneHook)