Commit 44eb577c authored by James Zern's avatar James Zern

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
parent 6f85cc66
...@@ -25,9 +25,10 @@ ...@@ -25,9 +25,10 @@
namespace { namespace {
using std::tr1::make_tuple; struct DecodeParam {
int threads;
typedef std::tr1::tuple<int, const char *> DecodeParam; const char *filename;
};
class InvalidFileTest class InvalidFileTest
: public ::libvpx_test::DecoderTest, : public ::libvpx_test::DecoderTest,
...@@ -73,8 +74,8 @@ TEST_P(InvalidFileTest, ReturnCode) { ...@@ -73,8 +74,8 @@ TEST_P(InvalidFileTest, ReturnCode) {
libvpx_test::CompressedVideoSource *video = NULL; libvpx_test::CompressedVideoSource *video = NULL;
const DecodeParam input = GET_PARAM(1); const DecodeParam input = GET_PARAM(1);
vpx_codec_dec_cfg_t cfg = {0}; vpx_codec_dec_cfg_t cfg = {0};
cfg.threads = std::tr1::get<0>(input); cfg.threads = input.threads;
const std::string filename = std::tr1::get<1>(input); const std::string filename = input.filename;
// Open compressed video file. // Open compressed video file.
if (filename.substr(filename.length() - 3, 3) == "ivf") { if (filename.substr(filename.length() - 3, 3) == "ivf") {
...@@ -101,25 +102,20 @@ TEST_P(InvalidFileTest, ReturnCode) { ...@@ -101,25 +102,20 @@ TEST_P(InvalidFileTest, ReturnCode) {
delete video; delete video;
} }
const char *const kVP9InvalidFileTests[] = { const DecodeParam kVP9InvalidFileTests[] = {
"invalid-vp90-01-v2.webm", {1, "invalid-vp90-01-v2.webm"},
"invalid-vp90-02-v2.webm", {1, "invalid-vp90-02-v2.webm"},
"invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf", {1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf"},
"invalid-vp90-03-v2.webm", {1, "invalid-vp90-03-v2.webm"},
"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-.ivf"},
"invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf", {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"},
}; };
INSTANTIATE_TEST_CASE_P( VP9_INSTANTIATE_TEST_CASE(InvalidFileTest,
VP9, InvalidFileTest, ::testing::ValuesIn(kVP9InvalidFileTests));
::testing::Combine(
::testing::Values(
static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)),
::testing::Combine(::testing::Values(1),
::testing::ValuesIn(kVP9InvalidFileTests))));
const DecodeParam kMultiThreadedVP9InvalidFileTests[] = { 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( INSTANTIATE_TEST_CASE_P(
......
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