From 44eb577cf767357bb34fdf4e49461c9418271dde Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 12 Jul 2014 13:34:36 -0700 Subject: [PATCH] invalid_file_test: convert test param from tuple to struct fixes visual studio 9 + apple clang builds where the template type is interpreted as char[] rather than const char*: ::f1_' : cannot specify explicit initializer for arrays error: array initializer must be an initializer list or string literal Change-Id: I27286ce341b2f7a09b6202caffd6b72f64fd2234 --- test/invalid_file_test.cc | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/test/invalid_file_test.cc b/test/invalid_file_test.cc index d260b86..8d7114f 100644 --- a/test/invalid_file_test.cc +++ b/test/invalid_file_test.cc @@ -25,9 +25,10 @@ namespace { -using std::tr1::make_tuple; - -typedef std::tr1::tuple DecodeParam; +struct DecodeParam { + int threads; + const char *filename; +}; class InvalidFileTest : public ::libvpx_test::DecoderTest, @@ -73,8 +74,8 @@ TEST_P(InvalidFileTest, ReturnCode) { libvpx_test::CompressedVideoSource *video = NULL; const DecodeParam input = GET_PARAM(1); vpx_codec_dec_cfg_t cfg = {0}; - cfg.threads = std::tr1::get<0>(input); - const std::string filename = std::tr1::get<1>(input); + cfg.threads = input.threads; + const std::string filename = input.filename; // Open compressed video file. if (filename.substr(filename.length() - 3, 3) == "ivf") { @@ -101,25 +102,20 @@ TEST_P(InvalidFileTest, ReturnCode) { delete video; } -const char *const kVP9InvalidFileTests[] = { - "invalid-vp90-01-v2.webm", - "invalid-vp90-02-v2.webm", - "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf", - "invalid-vp90-03-v2.webm", - "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf", - "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf", +const DecodeParam kVP9InvalidFileTests[] = { + {1, "invalid-vp90-01-v2.webm"}, + {1, "invalid-vp90-02-v2.webm"}, + {1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf"}, + {1, "invalid-vp90-03-v2.webm"}, + {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"}, + {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"}, }; -INSTANTIATE_TEST_CASE_P( - VP9, InvalidFileTest, - ::testing::Combine( - ::testing::Values( - static_cast(&libvpx_test::kVP9)), - ::testing::Combine(::testing::Values(1), - ::testing::ValuesIn(kVP9InvalidFileTests)))); +VP9_INSTANTIATE_TEST_CASE(InvalidFileTest, + ::testing::ValuesIn(kVP9InvalidFileTests)); const DecodeParam kMultiThreadedVP9InvalidFileTests[] = { - make_tuple(4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"), + {4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"}, }; INSTANTIATE_TEST_CASE_P( -- 2.7.4