Commit 1d4b2e2e authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Eliminate std::tr1 references

Summary:
`std::tuple` and `std::unordered_map` have long been standardized and supported by every platform we care about.
Beyond that MSVC is starting to remove the tr1 namespace entirely, so these references don't work under the newest MSVC.

Reviewed By: yfeldblum

Differential Revision: D7389783

fbshipit-source-id: c089490360ebf15ac23925f71e991602fda3d7a0
parent 091bfa60
......@@ -199,16 +199,15 @@ TEST(CompressionTestNeedsUncompressedLength, Simple) {
}
class CompressionTest
: public testing::TestWithParam<std::tr1::tuple<int, int, CodecType>> {
: public testing::TestWithParam<std::tuple<int, int, CodecType>> {
protected:
void SetUp() override {
auto tup = GetParam();
int lengthLog = std::tr1::get<0>(tup);
int lengthLog = std::get<0>(tup);
// Small hack to test empty data
uncompressedLength_ =
(lengthLog < 0) ? 0 : uint64_t(1) << std::tr1::get<0>(tup);
chunks_ = std::tr1::get<1>(tup);
codec_ = getCodec(std::tr1::get<2>(tup));
uncompressedLength_ = (lengthLog < 0) ? 0 : uint64_t(1) << std::get<0>(tup);
chunks_ = std::get<1>(tup);
codec_ = getCodec(std::get<2>(tup));
}
void runSimpleIOBufTest(const DataHolder& dh);
......@@ -313,12 +312,12 @@ INSTANTIATE_TEST_CASE_P(
testing::ValuesIn(availableCodecs())));
class CompressionVarintTest
: public testing::TestWithParam<std::tr1::tuple<int, CodecType>> {
: public testing::TestWithParam<std::tuple<int, CodecType>> {
protected:
void SetUp() override {
auto tup = GetParam();
uncompressedLength_ = uint64_t(1) << std::tr1::get<0>(tup);
codec_ = getCodec(std::tr1::get<1>(tup));
uncompressedLength_ = uint64_t(1) << std::get<0>(tup);
codec_ = getCodec(std::get<1>(tup));
}
void runSimpleTest(const DataHolder& dh);
......@@ -1429,15 +1428,15 @@ TEST(ZlibTest, DefaultOptions) {
}
}
class ZlibOptionsTest : public testing::TestWithParam<
std::tr1::tuple<ZlibFormat, int, int, int>> {
class ZlibOptionsTest
: public testing::TestWithParam<std::tuple<ZlibFormat, int, int, int>> {
protected:
void SetUp() override {
auto tup = GetParam();
options_.format = std::tr1::get<0>(tup);
options_.windowSize = std::tr1::get<1>(tup);
options_.memLevel = std::tr1::get<2>(tup);
options_.strategy = std::tr1::get<3>(tup);
options_.format = std::get<0>(tup);
options_.windowSize = std::get<1>(tup);
options_.memLevel = std::get<2>(tup);
options_.strategy = std::get<3>(tup);
codec_ = zlib::getStreamCodec(options_);
}
......
......@@ -848,13 +848,13 @@ enum BufType {
// chain element size, number of elements in chain, shared
class MoveToFbStringTest
: public ::testing::TestWithParam<std::tr1::tuple<int, int, bool, BufType>> {
: public ::testing::TestWithParam<std::tuple<int, int, bool, BufType>> {
protected:
void SetUp() override {
elementSize_ = std::tr1::get<0>(GetParam());
elementCount_ = std::tr1::get<1>(GetParam());
shared_ = std::tr1::get<2>(GetParam());
type_ = std::tr1::get<3>(GetParam());
elementSize_ = std::get<0>(GetParam());
elementCount_ = std::get<1>(GetParam());
shared_ = std::get<2>(GetParam());
type_ = std::get<3>(GetParam());
buf_ = makeBuf();
for (int i = 0; i < elementCount_ - 1; ++i) {
......
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