Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: source/libvpx/test/invalid_file_test.cc

Issue 554673004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/intrapred_test.cc ('k') | source/libvpx/test/md5_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 EXPECT_EQ(expected_res_dec, res_dec) 66 EXPECT_EQ(expected_res_dec, res_dec)
67 << "Results don't match: frame number = " << video.frame_number() 67 << "Results don't match: frame number = " << video.frame_number()
68 << ". (" << decoder->DecodeError() << ")"; 68 << ". (" << decoder->DecodeError() << ")";
69 69
70 return !HasFailure(); 70 return !HasFailure();
71 } 71 }
72 72
73 void RunTest() { 73 void RunTest() {
74 const DecodeParam input = GET_PARAM(1); 74 const DecodeParam input = GET_PARAM(1);
75 libvpx_test::CompressedVideoSource *video = NULL; 75 libvpx_test::CompressedVideoSource *video = NULL;
76 vpx_codec_dec_cfg_t cfg = {0}; 76 vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
77 cfg.threads = input.threads; 77 cfg.threads = input.threads;
78 const std::string filename = input.filename; 78 const std::string filename = input.filename;
79 79
80 // Open compressed video file. 80 // Open compressed video file.
81 if (filename.substr(filename.length() - 3, 3) == "ivf") { 81 if (filename.substr(filename.length() - 3, 3) == "ivf") {
82 video = new libvpx_test::IVFVideoSource(filename); 82 video = new libvpx_test::IVFVideoSource(filename);
83 } else if (filename.substr(filename.length() - 4, 4) == "webm") { 83 } else if (filename.substr(filename.length() - 4, 4) == "webm") {
84 #if CONFIG_WEBM_IO 84 #if CONFIG_WEBM_IO
85 video = new libvpx_test::WebMVideoSource(filename); 85 video = new libvpx_test::WebMVideoSource(filename);
86 #else 86 #else
(...skipping 19 matching lines...) Expand all
106 FILE *res_file_; 106 FILE *res_file_;
107 }; 107 };
108 108
109 TEST_P(InvalidFileTest, ReturnCode) { 109 TEST_P(InvalidFileTest, ReturnCode) {
110 RunTest(); 110 RunTest();
111 } 111 }
112 112
113 const DecodeParam kVP9InvalidFileTests[] = { 113 const DecodeParam kVP9InvalidFileTests[] = {
114 {1, "invalid-vp90-02-v2.webm"}, 114 {1, "invalid-vp90-02-v2.webm"},
115 {1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf"}, 115 {1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf"},
116 {1, "invalid-vp90-03-v2.webm"}, 116 {1, "invalid-vp90-03-v3.webm"},
117 {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"}, 117 {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"},
118 {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"}, 118 {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"},
119 {1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf"},
120 {1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf"},
121 {1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.ivf"},
119 }; 122 };
120 123
121 VP9_INSTANTIATE_TEST_CASE(InvalidFileTest, 124 VP9_INSTANTIATE_TEST_CASE(InvalidFileTest,
122 ::testing::ValuesIn(kVP9InvalidFileTests)); 125 ::testing::ValuesIn(kVP9InvalidFileTests));
123 126
124 // This class will include test vectors that are expected to fail 127 // This class will include test vectors that are expected to fail
125 // peek. However they are still expected to have no fatal failures. 128 // peek. However they are still expected to have no fatal failures.
126 class InvalidFileInvalidPeekTest : public InvalidFileTest { 129 class InvalidFileInvalidPeekTest : public InvalidFileTest {
127 protected: 130 protected:
128 InvalidFileInvalidPeekTest() : InvalidFileTest() {} 131 InvalidFileInvalidPeekTest() : InvalidFileTest() {}
129 virtual void HandlePeekResult(libvpx_test::Decoder *const decoder, 132 virtual void HandlePeekResult(libvpx_test::Decoder *const /*decoder*/,
130 libvpx_test::CompressedVideoSource *video, 133 libvpx_test::CompressedVideoSource* /*video*/,
131 const vpx_codec_err_t res_peek) {} 134 const vpx_codec_err_t /*res_peek*/) {}
132 }; 135 };
133 136
134 TEST_P(InvalidFileInvalidPeekTest, ReturnCode) { 137 TEST_P(InvalidFileInvalidPeekTest, ReturnCode) {
135 RunTest(); 138 RunTest();
136 } 139 }
137 140
138 const DecodeParam kVP9InvalidFileInvalidPeekTests[] = { 141 const DecodeParam kVP9InvalidFileInvalidPeekTests[] = {
139 {1, "invalid-vp90-01-v2.webm"}, 142 {1, "invalid-vp90-01-v2.webm"},
140 }; 143 };
141 144
142 VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest, 145 VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
143 ::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests)); 146 ::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests));
144 147
145 const DecodeParam kMultiThreadedVP9InvalidFileTests[] = { 148 const DecodeParam kMultiThreadedVP9InvalidFileTests[] = {
146 {4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"}, 149 {4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"},
150 {4, "invalid-"
151 "vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf"},
152 {2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.ivf"},
153 {4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.ivf"},
147 }; 154 };
148 155
149 INSTANTIATE_TEST_CASE_P( 156 INSTANTIATE_TEST_CASE_P(
150 VP9MultiThreaded, InvalidFileTest, 157 VP9MultiThreaded, InvalidFileTest,
151 ::testing::Combine( 158 ::testing::Combine(
152 ::testing::Values( 159 ::testing::Values(
153 static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)), 160 static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)),
154 ::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests))); 161 ::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests)));
155 } // namespace 162 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/intrapred_test.cc ('k') | source/libvpx/test/md5_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698