Commit 41928eed authored by Alex Converse's avatar Alex Converse Committed by Gerrit Code Review
Browse files

Merge "Automatically count test vectors and make the tables const."

Showing with 19 additions and 10 deletions
...@@ -462,5 +462,7 @@ TEST_F(ExternalFrameBufferTest, SetAfterDecode) { ...@@ -462,5 +462,7 @@ TEST_F(ExternalFrameBufferTest, SetAfterDecode) {
} }
VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test, VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
::testing::ValuesIn(libvpx_test::kVP9TestVectors)); ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
libvpx_test::kVP9TestVectors +
libvpx_test::kNumVP9TestVectors));
} // namespace } // namespace
...@@ -89,8 +89,12 @@ TEST_P(TestVectorTest, MD5Match) { ...@@ -89,8 +89,12 @@ TEST_P(TestVectorTest, MD5Match) {
} }
VP8_INSTANTIATE_TEST_CASE(TestVectorTest, VP8_INSTANTIATE_TEST_CASE(TestVectorTest,
::testing::ValuesIn(libvpx_test::kVP8TestVectors)); ::testing::ValuesIn(libvpx_test::kVP8TestVectors,
libvpx_test::kVP8TestVectors +
libvpx_test::kNumVP8TestVectors));
VP9_INSTANTIATE_TEST_CASE(TestVectorTest, VP9_INSTANTIATE_TEST_CASE(TestVectorTest,
::testing::ValuesIn(libvpx_test::kVP9TestVectors)); ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
libvpx_test::kVP9TestVectors +
libvpx_test::kNumVP9TestVectors));
} // namespace } // namespace
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
namespace libvpx_test { namespace libvpx_test {
#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
#if CONFIG_VP8_DECODER #if CONFIG_VP8_DECODER
const char *kVP8TestVectors[kNumVP8TestVectors] = { const char *const kVP8TestVectors[] = {
"vp80-00-comprehensive-001.ivf", "vp80-00-comprehensive-001.ivf",
"vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf", "vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf",
"vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf", "vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf",
...@@ -47,9 +49,10 @@ const char *kVP8TestVectors[kNumVP8TestVectors] = { ...@@ -47,9 +49,10 @@ const char *kVP8TestVectors[kNumVP8TestVectors] = {
"vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf", "vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf",
"vp80-06-smallsize.ivf" "vp80-06-smallsize.ivf"
}; };
const int kNumVP8TestVectors = NELEMENTS(kVP8TestVectors);
#endif // CONFIG_VP8_DECODER #endif // CONFIG_VP8_DECODER
#if CONFIG_VP9_DECODER #if CONFIG_VP9_DECODER
const char *kVP9TestVectors[kNumVP9TestVectors] = { const char *const kVP9TestVectors[] = {
"vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm", "vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
"vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm", "vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
"vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm", "vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm",
...@@ -163,6 +166,7 @@ const char *kVP9TestVectors[kNumVP9TestVectors] = { ...@@ -163,6 +166,7 @@ const char *kVP9TestVectors[kNumVP9TestVectors] = {
"vp90-2-12-droppable_2.ivf", "vp90-2-12-droppable_3.ivf", "vp90-2-12-droppable_2.ivf", "vp90-2-12-droppable_3.ivf",
"vp91-2-04-yv444.webm" "vp91-2-04-yv444.webm"
}; };
const int kNumVP9TestVectors = NELEMENTS(kVP9TestVectors);
#endif // CONFIG_VP9_DECODER #endif // CONFIG_VP9_DECODER
} // namespace libvpx_test } // namespace libvpx_test
...@@ -16,14 +16,13 @@ ...@@ -16,14 +16,13 @@
namespace libvpx_test { namespace libvpx_test {
#if CONFIG_VP8_DECODER #if CONFIG_VP8_DECODER
const int kNumVP8TestVectors = 62; extern const int kNumVP8TestVectors;
extern const char *kVP8TestVectors[kNumVP8TestVectors]; extern const char *const kVP8TestVectors[];
#endif #endif
#if CONFIG_VP9_DECODER #if CONFIG_VP9_DECODER
const int kNumVP9TestVectors = 223; extern const int kNumVP9TestVectors;
extern const char *const kVP9TestVectors[];
extern const char *kVP9TestVectors[kNumVP9TestVectors];
#endif // CONFIG_VP9_DECODER #endif // CONFIG_VP9_DECODER
} // namespace libvpx_test } // namespace libvpx_test
......
Supports Markdown
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