Commit 507ab831 authored by Michael Lee's avatar Michael Lee Committed by Facebook Github Bot

Fix various shadowing warnings within tests

Summary: A lot of shadowed variables in tests. Simple renaming should suffice.

Reviewed By: yfeldblum

Differential Revision: D6786138

fbshipit-source-id: 22c1c4d7cac13b367ed534a3f1d20714150b39f9
parent 90866787
......@@ -379,12 +379,12 @@ TEST(ConcurrentHashMap, EraseStressTest) {
exit(0);
}
EXPECT_TRUE(res);
auto res = m.find(k);
if (res == m.cend()) {
auto result = m.find(k);
if (result == m.cend()) {
printf("Thread %i lookup fail %li\n", t, k);
exit(0);
}
EXPECT_EQ(k, res->second);
EXPECT_EQ(k, result->second);
}
}
}));
......
......@@ -366,10 +366,10 @@ TEST(FlatCombining, folly_benchmark) {
static uint64_t test(
std::string name,
bool fc,
bool dedicated,
bool tc,
bool syncops,
bool fc_,
bool dedicated_,
bool tc_,
bool syncops_,
uint64_t base) {
uint64_t min = UINTMAX_MAX;
uint64_t max = 0;
......@@ -382,11 +382,11 @@ static uint64_t test(
FLAGS_numRecs,
FLAGS_work,
FLAGS_ops,
fc,
fc_,
simple,
dedicated,
tc,
syncops);
dedicated_,
tc_,
syncops_);
sum += dur;
min = std::min(min, dur);
max = std::max(max, dur);
......
......@@ -1078,8 +1078,8 @@ TEST(Gen, Cycle) {
s | cycle | take(4) | as<vector>());
}
{
int count = 3;
int* pcount = &count;
int c = 3;
int* pcount = &c;
auto countdown = GENERATOR(int) {
ASSERT_GE(*pcount, 0)
<< "Cycle should have stopped when it didnt' get values!";
......
......@@ -496,12 +496,12 @@ TEST(BucketedTimeSeries, avgTypeConversion) {
}
TEST(BucketedTimeSeries, forEachBucket) {
typedef BucketedTimeSeries<int64_t>::Bucket Bucket;
typedef BucketedTimeSeries<int64_t>::Bucket BucketSeries;
struct BucketInfo {
BucketInfo(const Bucket* b, TimePoint s, TimePoint ns)
BucketInfo(const BucketSeries* b, TimePoint s, TimePoint ns)
: bucket(b), start(s), nextStart(ns) {}
const Bucket* bucket;
const BucketSeries* bucket;
TimePoint start;
TimePoint nextStart;
};
......@@ -510,7 +510,7 @@ TEST(BucketedTimeSeries, forEachBucket) {
BucketedTimeSeries<int64_t> ts(data.numBuckets, seconds(data.duration));
vector<BucketInfo> info;
auto fn = [&](const Bucket& bucket,
auto fn = [&](const BucketSeries& bucket,
TimePoint bucketStart,
TimePoint bucketEnd) -> bool {
info.emplace_back(&bucket, bucketStart, bucketEnd);
......
......@@ -27,8 +27,6 @@ using namespace folly;
using namespace folly::test;
using folly::detail::EmulatedFutexAtomic;
typedef DeterministicSchedule DSched;
BENCHMARK(baton_pingpong_blocking, iters) {
run_pingpong_test<true, std::atomic>(iters);
}
......
......@@ -772,10 +772,10 @@ TEST(Ahm, erase_after_insert_race) {
// Repro for a bug when iterator didn't skip empty submaps.
TEST(Ahm, iterator_skips_empty_submaps) {
AtomicHashMap<uint64_t, uint64_t>::Config config;
config.growthFactor = 1;
AtomicHashMap<uint64_t, uint64_t>::Config conf;
conf.growthFactor = 1;
AtomicHashMap<uint64_t, uint64_t> map(1, config);
AtomicHashMap<uint64_t, uint64_t> map(1, conf);
map.insert(1, 1);
map.insert(2, 2);
......
......@@ -338,7 +338,7 @@ TEST(Poly, NullablePointer) {
Poly<INullablePointer> r = 42;
Poly<INullablePointer&> s = r;
static_assert(!poly_empty(s), "");
EXPECT_THROW(Poly<INullablePointer&> r(q), BadPolyAccess);
EXPECT_THROW(Poly<INullablePointer&> r_(q), BadPolyAccess);
}
namespace {
......
......@@ -103,12 +103,12 @@ void initDelims(int len) {
if (n == 8) {
n = 32;
}
auto s = generateString(n);
auto s_ = generateString(n);
if (rnd() % 2) {
// ~half of tests will find a hit
s[rnd() % s.size()] = 'a'; // yes, this could mean 'a' is a duplicate
s_[rnd() % s_.size()] = 'a'; // yes, this could mean 'a' is a duplicate
}
ffoDelim.push_back(s);
ffoDelim.push_back(s_);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment