| OLD | NEW |
| 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 |
| 11 #include "third_party/googletest/src/include/gtest/gtest.h" | 11 #include "third_party/googletest/src/include/gtest/gtest.h" |
| 12 | 12 |
| 13 #include "./vpx_config.h" | 13 #include "./vpx_config.h" |
| 14 #include "test/ivf_video_source.h" | 14 #include "test/ivf_video_source.h" |
| 15 #include "vpx/vp8dx.h" | 15 #include "vpx/vp8dx.h" |
| 16 #include "vpx/vpx_decoder.h" | 16 #include "vpx/vpx_decoder.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 #define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0])) | 20 #define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0])) |
| 21 | 21 |
| 22 TEST(DecodeAPI, InvalidParams) { | 22 TEST(DecodeAPI, InvalidParams) { |
| 23 static const vpx_codec_iface_t *kCodecs[] = { | 23 static const vpx_codec_iface_t *kCodecs[] = { |
| 24 #if CONFIG_VP8_DECODER | 24 #if CONFIG_VP8_DECODER |
| 25 &vpx_codec_vp8_dx_algo, | 25 &vpx_codec_vp8_dx_algo, |
| 26 #endif | 26 #endif |
| 27 #if CONFIG_VP9_DECODER | 27 #if CONFIG_VP9_DECODER |
| 28 &vpx_codec_vp9_dx_algo, | 28 &vpx_codec_vp9_dx_algo, |
| 29 #endif | 29 #endif |
| 30 #if CONFIG_VP10_DECODER |
| 31 &vpx_codec_vp10_dx_algo, |
| 32 #endif |
| 30 }; | 33 }; |
| 31 uint8_t buf[1] = {0}; | 34 uint8_t buf[1] = {0}; |
| 32 vpx_codec_ctx_t dec; | 35 vpx_codec_ctx_t dec; |
| 33 | 36 |
| 34 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(NULL, NULL, NULL, 0)); | 37 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(NULL, NULL, NULL, 0)); |
| 35 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(&dec, NULL, NULL, 0)); | 38 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(&dec, NULL, NULL, 0)); |
| 36 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_decode(NULL, NULL, 0, NULL, 0)); | 39 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_decode(NULL, NULL, 0, NULL, 0)); |
| 37 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_decode(NULL, buf, 0, NULL, 0)); | 40 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_decode(NULL, buf, 0, NULL, 0)); |
| 38 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, | 41 EXPECT_EQ(VPX_CODEC_INVALID_PARAM, |
| 39 vpx_codec_decode(NULL, buf, NELEMENTS(buf), NULL, 0)); | 42 vpx_codec_decode(NULL, buf, NELEMENTS(buf), NULL, 0)); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 #endif | 142 #endif |
| 140 vpx_codec_iter_t iter = NULL; | 143 vpx_codec_iter_t iter = NULL; |
| 141 EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter)); | 144 EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter)); |
| 142 | 145 |
| 143 TestVp9Controls(&dec); | 146 TestVp9Controls(&dec); |
| 144 EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec)); | 147 EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec)); |
| 145 } | 148 } |
| 146 #endif // CONFIG_VP9_DECODER | 149 #endif // CONFIG_VP9_DECODER |
| 147 | 150 |
| 148 } // namespace | 151 } // namespace |
| OLD | NEW |