From: James Zern Date: Wed, 28 Mar 2018 19:42:27 +0000 (-0700) Subject: test: use testing::*tuple instead of std::tr1 X-Git-Tag: v1.8.0~765^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db49a22cfa618479b963d40e7ef7c48a6bc4a97e;p=platform%2Fupstream%2Flibvpx.git test: use testing::*tuple instead of std::tr1 googletest imports tuple into testing to allow for compatibility across c++ versions where tuple may be in std::tr1 or std. fixes deprecation warnings under visual studio 2017 Change-Id: Id78b372d5478b12d8c8f63fd3f2166fec25aa8be --- diff --git a/test/avg_test.cc b/test/avg_test.cc index ad21198..9c6410b 100644 --- a/test/avg_test.cc +++ b/test/avg_test.cc @@ -91,7 +91,7 @@ class AverageTestBase : public ::testing::Test { }; typedef unsigned int (*AverageFunction)(const uint8_t *s, int pitch); -typedef std::tr1::tuple AvgFunc; +typedef ::testing::tuple AvgFunc; class AverageTest : public AverageTestBase, public ::testing::WithParamInterface { @@ -122,7 +122,7 @@ class AverageTest : public AverageTestBase, typedef void (*IntProRowFunc)(int16_t hbuf[16], uint8_t const *ref, const int ref_stride, const int height); -typedef std::tr1::tuple IntProRowParam; +typedef ::testing::tuple IntProRowParam; class IntProRowTest : public AverageTestBase, public ::testing::WithParamInterface { @@ -164,7 +164,7 @@ class IntProRowTest : public AverageTestBase, typedef int16_t (*IntProColFunc)(uint8_t const *ref, const int width); -typedef std::tr1::tuple IntProColParam; +typedef ::testing::tuple IntProColParam; class IntProColTest : public AverageTestBase, public ::testing::WithParamInterface { @@ -189,7 +189,7 @@ class IntProColTest : public AverageTestBase, }; typedef int (*SatdFunc)(const tran_low_t *coeffs, int length); -typedef std::tr1::tuple SatdTestParam; +typedef ::testing::tuple SatdTestParam; class SatdTest : public ::testing::Test, public ::testing::WithParamInterface { @@ -235,7 +235,7 @@ class SatdTest : public ::testing::Test, typedef int64_t (*BlockErrorFunc)(const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size); -typedef std::tr1::tuple BlockErrorTestFPParam; +typedef ::testing::tuple BlockErrorTestFPParam; class BlockErrorTestFP : public ::testing::Test, @@ -428,7 +428,7 @@ TEST_P(BlockErrorTestFP, DISABLED_Speed) { printf("blocksize: %4d time: %4d us\n", blocksize, elapsed_time); } -using std::tr1::make_tuple; +using ::testing::make_tuple; INSTANTIATE_TEST_CASE_P( C, AverageTest, diff --git a/test/blockiness_test.cc b/test/blockiness_test.cc index 08190c9..c6a3be1 100644 --- a/test/blockiness_test.cc +++ b/test/blockiness_test.cc @@ -141,7 +141,7 @@ class BlockinessTestBase : public ::testing::Test { }; #if CONFIG_VP9_ENCODER -typedef std::tr1::tuple BlockinessParam; +typedef ::testing::tuple BlockinessParam; class BlockinessVP9Test : public BlockinessTestBase, public ::testing::WithParamInterface { @@ -208,7 +208,7 @@ TEST_P(BlockinessVP9Test, WorstCaseBlockiness) { } #endif // CONFIG_VP9_ENCODER -using std::tr1::make_tuple; +using ::testing::make_tuple; //------------------------------------------------------------------------------ // C functions diff --git a/test/codec_factory.h b/test/codec_factory.h index d5882ed..294ab04 100644 --- a/test/codec_factory.h +++ b/test/codec_factory.h @@ -53,23 +53,22 @@ class CodecFactory { template class CodecTestWithParam : public ::testing::TestWithParam< - std::tr1::tuple > {}; + ::testing::tuple > {}; template class CodecTestWith2Params : public ::testing::TestWithParam< - std::tr1::tuple > {}; + ::testing::tuple > {}; template class CodecTestWith3Params : public ::testing::TestWithParam< - std::tr1::tuple > {}; + ::testing::tuple > {}; template class CodecTestWith4Params - : public ::testing::TestWithParam< - std::tr1::tuple > { -}; + : public ::testing::TestWithParam< ::testing::tuple< + const libvpx_test::CodecFactory *, T1, T2, T3, T4> > {}; /* * VP8 Codec Definitions diff --git a/test/consistency_test.cc b/test/consistency_test.cc index c21751f..f6660da 100644 --- a/test/consistency_test.cc +++ b/test/consistency_test.cc @@ -127,7 +127,7 @@ class ConsistencyTestBase : public ::testing::Test { }; #if CONFIG_VP9_ENCODER -typedef std::tr1::tuple ConsistencyParam; +typedef ::testing::tuple ConsistencyParam; class ConsistencyVP9Test : public ConsistencyTestBase, public ::testing::WithParamInterface { @@ -198,7 +198,7 @@ TEST_P(ConsistencyVP9Test, ConsistencyIsZero) { } #endif // CONFIG_VP9_ENCODER -using std::tr1::make_tuple; +using ::testing::make_tuple; //------------------------------------------------------------------------------ // C functions diff --git a/test/convolve_test.cc b/test/convolve_test.cc index 3f03671..9739eed 100644 --- a/test/convolve_test.cc +++ b/test/convolve_test.cc @@ -77,7 +77,7 @@ struct ConvolveFunctions { int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth. }; -typedef std::tr1::tuple ConvolveParam; +typedef ::testing::tuple ConvolveParam; #define ALL_SIZES(convolve_fn) \ make_tuple(4, 4, &convolve_fn), make_tuple(8, 4, &convolve_fn), \ @@ -1042,7 +1042,7 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { } #endif -using std::tr1::make_tuple; +using ::testing::make_tuple; #if CONFIG_VP9_HIGHBITDEPTH #define WRAP(func, bd) \ diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc index ce0bd37..8728241 100644 --- a/test/dct16x16_test.cc +++ b/test/dct16x16_test.cc @@ -229,9 +229,10 @@ typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, int tx_type); -typedef std::tr1::tuple Dct16x16Param; -typedef std::tr1::tuple Ht16x16Param; -typedef std::tr1::tuple +typedef ::testing::tuple + Dct16x16Param; +typedef ::testing::tuple Ht16x16Param; +typedef ::testing::tuple Idct16x16Param; void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride, @@ -744,7 +745,7 @@ TEST_P(InvTrans16x16DCT, CompareReference) { CompareInvReference(ref_txfm_, thresh_); } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if CONFIG_VP9_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc index a95ff97..0275d83 100644 --- a/test/dct32x32_test.cc +++ b/test/dct32x32_test.cc @@ -66,7 +66,7 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs], typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride); typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride); -typedef std::tr1::tuple +typedef ::testing::tuple Trans32x32Param; #if CONFIG_VP9_HIGHBITDEPTH @@ -292,7 +292,7 @@ TEST_P(Trans32x32Test, InverseAccuracy) { } } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if CONFIG_VP9_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( diff --git a/test/dct_partial_test.cc b/test/dct_partial_test.cc index f06ff40..6636f56 100644 --- a/test/dct_partial_test.cc +++ b/test/dct_partial_test.cc @@ -26,10 +26,10 @@ #include "vpx/vpx_integer.h" #include "vpx_dsp/vpx_dsp_common.h" +using ::testing::make_tuple; +using ::testing::tuple; using libvpx_test::ACMRandom; using libvpx_test::Buffer; -using std::tr1::make_tuple; -using std::tr1::tuple; namespace { typedef void (*PartialFdctFunc)(const int16_t *in, tran_low_t *out, int stride); diff --git a/test/dct_test.cc b/test/dct_test.cc index d3acf76..1006215 100644 --- a/test/dct_test.cc +++ b/test/dct_test.cc @@ -26,10 +26,10 @@ #include "vpx/vpx_integer.h" #include "vpx_ports/mem.h" +using ::testing::make_tuple; +using ::testing::tuple; using libvpx_test::ACMRandom; using libvpx_test::Buffer; -using std::tr1::make_tuple; -using std::tr1::tuple; namespace { typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride); diff --git a/test/decode_perf_test.cc b/test/decode_perf_test.cc index ee26c3c..e2169ad 100644 --- a/test/decode_perf_test.cc +++ b/test/decode_perf_test.cc @@ -21,7 +21,7 @@ #include "./ivfenc.h" #include "./vpx_version.h" -using std::tr1::make_tuple; +using ::testing::make_tuple; namespace { @@ -34,7 +34,7 @@ const char kNewEncodeOutputFile[] = "new_encode.ivf"; /* DecodePerfTest takes a tuple of filename + number of threads to decode with */ -typedef std::tr1::tuple DecodePerfParam; +typedef ::testing::tuple DecodePerfParam; const DecodePerfParam kVP9DecodePerfVectors[] = { make_tuple("vp90-2-bbb_426x240_tile_1x1_180kbps.webm", 1), diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index d1b49df..a86d9e3 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -43,9 +43,9 @@ typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, int tx_type); -typedef std::tr1::tuple Dct8x8Param; -typedef std::tr1::tuple Ht8x8Param; -typedef std::tr1::tuple Idct8x8Param; +typedef ::testing::tuple Dct8x8Param; +typedef ::testing::tuple Ht8x8Param; +typedef ::testing::tuple Idct8x8Param; void reference_8x8_dct_1d(const double in[8], double out[8]) { const double kInvSqrt2 = 0.707106781186547524400844362104; @@ -628,7 +628,7 @@ TEST_P(InvTrans8x8DCT, CompareReference) { CompareInvReference(ref_txfm_, thresh_); } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if CONFIG_VP9_HIGHBITDEPTH INSTANTIATE_TEST_CASE_P( diff --git a/test/lpf_test.cc b/test/lpf_test.cc index e04b996..1977623 100644 --- a/test/lpf_test.cc +++ b/test/lpf_test.cc @@ -56,8 +56,8 @@ typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0, const uint8_t *thresh1); #endif // CONFIG_VP9_HIGHBITDEPTH -typedef std::tr1::tuple loop8_param_t; -typedef std::tr1::tuple dualloop8_param_t; +typedef ::testing::tuple loop8_param_t; +typedef ::testing::tuple dualloop8_param_t; void InitInput(Pixel *s, Pixel *ref_s, ACMRandom *rnd, const uint8_t limit, const int mask, const int32_t p, const int i) { @@ -402,7 +402,7 @@ TEST_P(Loop8Test9Param, ValueCheck) { << "First failed at test case " << first_failure; } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if HAVE_SSE2 #if CONFIG_VP9_HIGHBITDEPTH diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc index f7b50f5..6fd4061 100644 --- a/test/partial_idct_test.cc +++ b/test/partial_idct_test.cc @@ -51,8 +51,8 @@ void highbd_wrapper(const tran_low_t *in, uint8_t *out, int stride, int bd) { } #endif -typedef std::tr1::tuple +typedef ::testing::tuple PartialInvTxfmParam; const int kMaxNumCoeffs = 1024; const int kCountTestBlock = 1000; @@ -324,7 +324,7 @@ TEST_P(PartialIDctTest, DISABLED_Speed) { << "Error: partial inverse transform produces different results"; } -using std::tr1::make_tuple; +using ::testing::make_tuple; const PartialInvTxfmParam c_partial_idct_tests[] = { #if CONFIG_VP9_HIGHBITDEPTH diff --git a/test/predict_test.cc b/test/predict_test.cc index 9f366ae..f6b4df0 100644 --- a/test/predict_test.cc +++ b/test/predict_test.cc @@ -24,14 +24,14 @@ namespace { +using ::testing::make_tuple; using libvpx_test::ACMRandom; -using std::tr1::make_tuple; typedef void (*PredictFunc)(uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch); -typedef std::tr1::tuple PredictParam; +typedef ::testing::tuple PredictParam; class PredictTestBase : public ::testing::TestWithParam { public: diff --git a/test/quantize_test.cc b/test/quantize_test.cc index 40bb264..f470cc6 100644 --- a/test/quantize_test.cc +++ b/test/quantize_test.cc @@ -33,10 +33,10 @@ const int kNumBlockEntries = 16; typedef void (*VP8Quantize)(BLOCK *b, BLOCKD *d); -typedef std::tr1::tuple VP8QuantizeParam; +typedef ::testing::tuple VP8QuantizeParam; +using ::testing::make_tuple; using libvpx_test::ACMRandom; -using std::tr1::make_tuple; // Create and populate a VP8_COMP instance which has a complete set of // quantization inputs as well as a second MACROBLOCKD for output. diff --git a/test/sum_squares_test.cc b/test/sum_squares_test.cc index e9d2efa..910718b 100644 --- a/test/sum_squares_test.cc +++ b/test/sum_squares_test.cc @@ -28,7 +28,7 @@ namespace { const int kNumIterations = 10000; typedef uint64_t (*SSI16Func)(const int16_t *src, int stride, int size); -typedef std::tr1::tuple SumSquaresParam; +typedef ::testing::tuple SumSquaresParam; class SumSquaresTest : public ::testing::TestWithParam { public: @@ -102,7 +102,7 @@ TEST_P(SumSquaresTest, ExtremeValues) { } } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if HAVE_SSE2 INSTANTIATE_TEST_CASE_P( diff --git a/test/superframe_test.cc b/test/superframe_test.cc index 421dfcc..f74e8be 100644 --- a/test/superframe_test.cc +++ b/test/superframe_test.cc @@ -18,7 +18,7 @@ namespace { const int kTestMode = 0; -typedef std::tr1::tuple SuperframeTestParam; +typedef ::testing::tuple SuperframeTestParam; class SuperframeTest : public ::libvpx_test::EncoderTest, @@ -31,7 +31,7 @@ class SuperframeTest virtual void SetUp() { InitializeConfig(); const SuperframeTestParam input = GET_PARAM(1); - const libvpx_test::TestMode mode = std::tr1::get(input); + const libvpx_test::TestMode mode = ::testing::get(input); SetMode(mode); sf_count_ = 0; sf_count_max_ = INT_MAX; diff --git a/test/test_vector_test.cc b/test/test_vector_test.cc index 1879b3d..b0f2b81 100644 --- a/test/test_vector_test.cc +++ b/test/test_vector_test.cc @@ -31,7 +31,7 @@ namespace { const int kThreads = 0; const int kFileName = 1; -typedef std::tr1::tuple DecodeParam; +typedef ::testing::tuple DecodeParam; class TestVectorTest : public ::libvpx_test::DecoderTest, public ::libvpx_test::CodecTestWithParam { @@ -88,12 +88,12 @@ class TestVectorTest : public ::libvpx_test::DecoderTest, // the test failed. TEST_P(TestVectorTest, MD5Match) { const DecodeParam input = GET_PARAM(1); - const std::string filename = std::tr1::get(input); + const std::string filename = ::testing::get(input); vpx_codec_flags_t flags = 0; vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t(); char str[256]; - cfg.threads = std::tr1::get(input); + cfg.threads = ::testing::get(input); snprintf(str, sizeof(str) / sizeof(str[0]) - 1, "file: %s threads: %d", filename.c_str(), cfg.threads); diff --git a/test/util.h b/test/util.h index 1f2540e..aac676d 100644 --- a/test/util.h +++ b/test/util.h @@ -17,7 +17,7 @@ #include "vpx/vpx_image.h" // Macros -#define GET_PARAM(k) std::tr1::get(GetParam()) +#define GET_PARAM(k) ::testing::get(GetParam()) inline double compute_psnr(const vpx_image_t *img1, const vpx_image_t *img2) { assert((img1->fmt == img2->fmt) && (img1->d_w == img2->d_w) && diff --git a/test/vp9_block_error_test.cc b/test/vp9_block_error_test.cc index 0b4d1df..fa9b6a6 100644 --- a/test/vp9_block_error_test.cc +++ b/test/vp9_block_error_test.cc @@ -35,7 +35,7 @@ typedef int64_t (*HBDBlockErrorFunc)(const tran_low_t *coeff, intptr_t block_size, int64_t *ssz, int bps); -typedef std::tr1::tuple +typedef ::testing::tuple BlockErrorParam; typedef int64_t (*BlockErrorFunc)(const tran_low_t *coeff, @@ -168,7 +168,7 @@ TEST_P(BlockErrorTest, ExtremeValues) { << "First failed at test case " << first_failure; } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if HAVE_SSE2 const BlockErrorParam sse2_block_error_tests[] = { diff --git a/test/vp9_denoiser_test.cc b/test/vp9_denoiser_test.cc index 56ca257..e3a057b 100644 --- a/test/vp9_denoiser_test.cc +++ b/test/vp9_denoiser_test.cc @@ -35,7 +35,8 @@ typedef int (*Vp9DenoiserFilterFunc)(const uint8_t *sig, int sig_stride, uint8_t *avg, int avg_stride, int increase_denoising, BLOCK_SIZE bs, int motion_magnitude); -typedef std::tr1::tuple VP9DenoiserTestParam; +typedef ::testing::tuple + VP9DenoiserTestParam; class VP9DenoiserTest : public ::testing::Test, @@ -99,7 +100,7 @@ TEST_P(VP9DenoiserTest, BitexactCheck) { } } -using std::tr1::make_tuple; +using ::testing::make_tuple; // Test for all block size. #if HAVE_SSE2 diff --git a/test/vp9_quantize_test.cc b/test/vp9_quantize_test.cc index f2234f0..4740cad 100644 --- a/test/vp9_quantize_test.cc +++ b/test/vp9_quantize_test.cc @@ -41,8 +41,8 @@ typedef void (*QuantizeFunc)(const tran_low_t *coeff, intptr_t count, tran_low_t *dqcoeff, const int16_t *dequant, uint16_t *eob, const int16_t *scan, const int16_t *iscan); -typedef std::tr1::tuple +typedef ::testing::tuple QuantizeParam; // Wrapper for FP version which does not use zbin or quant_shift. @@ -457,7 +457,7 @@ TEST_P(VP9QuantizeTest, DISABLED_Speed) { } } -using std::tr1::make_tuple; +using ::testing::make_tuple; #if HAVE_SSE2 #if CONFIG_VP9_HIGHBITDEPTH