History

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

James Zern committed 12 years ago

Commit 44eb5771 parent 6f85cc61 file · +16 −20Browse files

Showing the changes to test/invalid_file_test.cc (1 of 1 file). Show all

Unified · Split

test/invalid_file_test.cc+16−20
@@ -25,9 +25,10 @@ · 24 unmodified lines
2525
2626 namespace {
2727
28−using std::tr1::make_tuple;
29−
30−typedef std::tr1::tuple<int, const char *> DecodeParam;
28+struct DecodeParam {
29+ int threads;
30+ const char *filename;
31+};
3132
3233 class InvalidFileTest
3334 : public ::libvpx_test::DecoderTest,
@@ -73,8 +74,8 @@ TEST_P(InvalidFileTest, ReturnCode) { · 39 unmodified lines
7374 libvpx_test::CompressedVideoSource *video = NULL;
7475 const DecodeParam input = GET_PARAM(1);
7576 vpx_codec_dec_cfg_t cfg = {0};
76− cfg.threads = std::tr1::get<0>(input);
77− const std::string filename = std::tr1::get<1>(input);
77+ cfg.threads = input.threads;
78+ const std::string filename = input.filename;
7879
7980 // Open compressed video file.
8081 if (filename.substr(filename.length() - 3, 3) == "ivf") {
@@ -101,25 +102,20 @@ TEST_P(InvalidFileTest, ReturnCode) { · 20 unmodified lines
101102 delete video;
102103 }
103104
104−const char *const kVP9InvalidFileTests[] = {
105− "invalid-vp90-01-v2.webm",
106− "invalid-vp90-02-v2.webm",
107− "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf",
108− "invalid-vp90-03-v2.webm",
109− "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf",
110− "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf",
105+const DecodeParam kVP9InvalidFileTests[] = {
106+ {1, "invalid-vp90-01-v2.webm"},
107+ {1, "invalid-vp90-02-v2.webm"},
108+ {1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf"},
109+ {1, "invalid-vp90-03-v2.webm"},
110+ {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"},
111+ {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"},
111112 };
112113
113−INSTANTIATE_TEST_CASE_P(
114− VP9, InvalidFileTest,
115− ::testing::Combine(
116− ::testing::Values(
117− static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)),
118− ::testing::Combine(::testing::Values(1),
119− ::testing::ValuesIn(kVP9InvalidFileTests))));
114+VP9_INSTANTIATE_TEST_CASE(InvalidFileTest,
115+ ::testing::ValuesIn(kVP9InvalidFileTests));
120116
121117 const DecodeParam kMultiThreadedVP9InvalidFileTests[] = {
122− make_tuple(4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"),
118+ {4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"},
123119 };
124120
125121 INSTANTIATE_TEST_CASE_P(

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t