| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC 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 /* | |
| 12 * This file includes unit tests for the VP8 packetizer. | |
| 13 */ | |
| 14 | |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" | 13 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" |
| 18 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.h" | 14 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.h" |
| 19 #include "webrtc/typedefs.h" | 15 #include "webrtc/typedefs.h" |
| 20 | 16 |
| 21 #define CHECK_ARRAY_SIZE(expected_size, array) \ | 17 #define CHECK_ARRAY_SIZE(expected_size, array) \ |
| 22 static_assert(expected_size == sizeof(array) / sizeof(array[0]), \ | 18 static_assert(expected_size == sizeof(array) / sizeof(array[0]), \ |
| 23 "check array size"); | 19 "check array size"); |
| 24 | 20 |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 input_header.layerSync); | 593 input_header.layerSync); |
| 598 } | 594 } |
| 599 | 595 |
| 600 TEST_F(RtpDepacketizerVp8Test, TestEmptyPayload) { | 596 TEST_F(RtpDepacketizerVp8Test, TestEmptyPayload) { |
| 601 // Using a wild pointer to crash on accesses from inside the depacketizer. | 597 // Using a wild pointer to crash on accesses from inside the depacketizer. |
| 602 uint8_t* garbage_ptr = reinterpret_cast<uint8_t*>(0x4711); | 598 uint8_t* garbage_ptr = reinterpret_cast<uint8_t*>(0x4711); |
| 603 RtpDepacketizer::ParsedPayload payload; | 599 RtpDepacketizer::ParsedPayload payload; |
| 604 EXPECT_FALSE(depacketizer_->Parse(&payload, garbage_ptr, 0)); | 600 EXPECT_FALSE(depacketizer_->Parse(&payload, garbage_ptr, 0)); |
| 605 } | 601 } |
| 606 } // namespace webrtc | 602 } // namespace webrtc |
| OLD | NEW |