From 51490e5654263c3b47195929f9fcdad16f4fdff2 Mon Sep 17 00:00:00 2001 From: Joshua Litt Date: Mon, 18 Nov 2013 17:07:55 -0800 Subject: [PATCH] Removing PARAMS macro for consistency Change-Id: I23ed873a6c47b15491a2ffbcdd4f0fdeef1207a0 --- test/convolve_test.cc | 4 +++- test/dct16x16_test.cc | 13 +++++++++---- test/dct32x32_test.cc | 4 +++- test/fdct4x4_test.cc | 7 +++++-- test/fdct8x8_test.cc | 13 +++++++++---- test/sixtap_predict_test.cc | 5 ++++- test/util.h | 1 - 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/test/convolve_test.cc b/test/convolve_test.cc index abeb4bd50..9ab60b1c3 100644 --- a/test/convolve_test.cc +++ b/test/convolve_test.cc @@ -44,6 +44,8 @@ struct ConvolveFunctions { convolve_fn_t hv8_avg_; }; +typedef std::tr1::tuple convolve_param_t; + // Reference 8-tap subpixel filter, slightly modified to fit into this test. #define VP9_FILTER_WEIGHT 128 #define VP9_FILTER_SHIFT 7 @@ -169,7 +171,7 @@ void filter_average_block2d_8_c(const uint8_t *src_ptr, output_width, output_height); } -class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) { +class ConvolveTest : public ::testing::TestWithParam { public: static void SetUpTestCase() { // Force input_ to be unaligned, output to be 16 byte aligned. diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc index b61df8d0d..5496d0b62 100644 --- a/test/dct16x16_test.cc +++ b/test/dct16x16_test.cc @@ -264,6 +264,9 @@ typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, int tx_type); +typedef std::tr1::tuple dct_16x16_param_t; +typedef std::tr1::tuple ht_16x16_param_t; + void fdct16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { vp9_fdct16x16_c(in, out, stride); } @@ -412,8 +415,9 @@ class Trans16x16TestBase { fht_t fwd_txfm_ref; }; -class Trans16x16DCT : public Trans16x16TestBase, - public PARAMS(fdct_t, idct_t, int) { +class Trans16x16DCT + : public Trans16x16TestBase, + public ::testing::TestWithParam { public: virtual ~Trans16x16DCT() {} @@ -454,8 +458,9 @@ TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); } -class Trans16x16HT : public Trans16x16TestBase, - public PARAMS(fht_t, iht_t, int) { +class Trans16x16HT + : public Trans16x16TestBase, + public ::testing::TestWithParam { public: virtual ~Trans16x16HT() {} diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc index 1e792da8d..2df3b6fe9 100644 --- a/test/dct32x32_test.cc +++ b/test/dct32x32_test.cc @@ -77,7 +77,9 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs], typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride); typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride); -class Trans32x32Test : public PARAMS(fwd_txfm_t, inv_txfm_t, int) { +typedef std::tr1::tuple trans_32x32_param_t; + +class Trans32x32Test : public ::testing::TestWithParam { public: virtual ~Trans32x32Test() {} virtual void SetUp() { diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc index 9d8b0bd3e..67426eb74 100644 --- a/test/fdct4x4_test.cc +++ b/test/fdct4x4_test.cc @@ -36,6 +36,9 @@ typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, int tx_type); +typedef std::tr1::tuple dct_4x4_param_t; +typedef std::tr1::tuple ht_4x4_param_t; + void fdct4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { vp9_fdct4x4_c(in, out, stride); } @@ -183,7 +186,7 @@ class Trans4x4TestBase { class Trans4x4DCT : public Trans4x4TestBase, - public PARAMS(fdct_t, idct_t, int) { + public ::testing::TestWithParam { public: virtual ~Trans4x4DCT() {} @@ -226,7 +229,7 @@ TEST_P(Trans4x4DCT, InvAccuracyCheck) { class Trans4x4HT : public Trans4x4TestBase, - public PARAMS(fht_t, iht_t, int) { + public ::testing::TestWithParam { public: virtual ~Trans4x4HT() {} diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index 3777b1151..19ffe26aa 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -35,6 +35,9 @@ typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride, typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride, int tx_type); +typedef std::tr1::tuple dct_8x8_param_t; +typedef std::tr1::tuple ht_8x8_param_t; + void fdct8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) { vp9_fdct8x8_c(in, out, stride); } @@ -215,8 +218,9 @@ class FwdTrans8x8TestBase { fht_t fwd_txfm_ref; }; -class FwdTrans8x8DCT : public FwdTrans8x8TestBase, - public PARAMS(fdct_t, idct_t, int) { +class FwdTrans8x8DCT + : public FwdTrans8x8TestBase, + public ::testing::TestWithParam { public: virtual ~FwdTrans8x8DCT() {} @@ -254,8 +258,9 @@ TEST_P(FwdTrans8x8DCT, ExtremalCheck) { RunExtremalCheck(); } -class FwdTrans8x8HT : public FwdTrans8x8TestBase, - public PARAMS(fht_t, iht_t, int) { +class FwdTrans8x8HT + : public FwdTrans8x8TestBase, + public ::testing::TestWithParam { public: virtual ~FwdTrans8x8HT() {} diff --git a/test/sixtap_predict_test.cc b/test/sixtap_predict_test.cc index ee4faac37..655146dbf 100644 --- a/test/sixtap_predict_test.cc +++ b/test/sixtap_predict_test.cc @@ -32,7 +32,10 @@ typedef void (*sixtap_predict_fn_t)(uint8_t *src_ptr, uint8_t *dst_ptr, int dst_pitch); -class SixtapPredictTest : public PARAMS(int, int, sixtap_predict_fn_t) { +typedef std::tr1::tuple sixtap_predict_param_t; + +class SixtapPredictTest + : public ::testing::TestWithParam { public: static void SetUpTestCase() { src_ = reinterpret_cast(vpx_memalign(kDataAlignment, kSrcSize)); diff --git a/test/util.h b/test/util.h index 4d7f3d41e..3c45721fa 100644 --- a/test/util.h +++ b/test/util.h @@ -17,7 +17,6 @@ #include "vpx/vpx_image.h" // Macros -#define PARAMS(...) ::testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > > #define GET_PARAM(k) std::tr1::get< k >(GetParam()) static double compute_psnr(const vpx_image_t *img1, -- 2.40.0