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 #include "webrtc/test/gtest.h" | |
12 #include "webrtc/modules/media_file/media_file.h" | 11 #include "webrtc/modules/media_file/media_file.h" |
13 #include "webrtc/system_wrappers/include/sleep.h" | 12 #include "webrtc/system_wrappers/include/sleep.h" |
| 13 #include "webrtc/test/gtest.h" |
14 #include "webrtc/test/testsupport/fileutils.h" | 14 #include "webrtc/test/testsupport/fileutils.h" |
15 | 15 |
16 class MediaFileTest : public testing::Test { | 16 class MediaFileTest : public testing::Test { |
17 protected: | 17 protected: |
18 void SetUp() { | 18 void SetUp() { |
19 // Use number 0 as the the identifier and pass to CreateMediaFile. | 19 // Use number 0 as the the identifier and pass to CreateMediaFile. |
20 media_file_ = webrtc::MediaFile::CreateMediaFile(0); | 20 media_file_ = webrtc::MediaFile::CreateMediaFile(0); |
21 ASSERT_TRUE(media_file_ != NULL); | 21 ASSERT_TRUE(media_file_ != NULL); |
22 } | 22 } |
23 void TearDown() { | 23 void TearDown() { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 uint8_t header[kHeaderSize]; | 97 uint8_t header[kHeaderSize]; |
98 ASSERT_EQ(1u, fread(header, kHeaderSize, 1, f)); | 98 ASSERT_EQ(1u, fread(header, kHeaderSize, 1, f)); |
99 EXPECT_EQ(0, memcmp(kExpectedHeader, header, kHeaderSize)); | 99 EXPECT_EQ(0, memcmp(kExpectedHeader, header, kHeaderSize)); |
100 | 100 |
101 uint8_t payload[kPayloadSize]; | 101 uint8_t payload[kPayloadSize]; |
102 ASSERT_EQ(1u, fread(payload, kPayloadSize, 1, f)); | 102 ASSERT_EQ(1u, fread(payload, kPayloadSize, 1, f)); |
103 EXPECT_EQ(0, memcmp(kFakeData, payload, kPayloadSize)); | 103 EXPECT_EQ(0, memcmp(kFakeData, payload, kPayloadSize)); |
104 | 104 |
105 EXPECT_EQ(0, fclose(f)); | 105 EXPECT_EQ(0, fclose(f)); |
106 } | 106 } |
OLD | NEW |