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 "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "webrtc/modules/media_file/interface/media_file.h" | 12 #include "webrtc/modules/media_file/include/media_file.h" |
13 #include "webrtc/system_wrappers/include/sleep.h" | 13 #include "webrtc/system_wrappers/include/sleep.h" |
14 #include "webrtc/test/testsupport/fileutils.h" | 14 #include "webrtc/test/testsupport/fileutils.h" |
15 #include "webrtc/test/testsupport/gtest_disable.h" | 15 #include "webrtc/test/testsupport/gtest_disable.h" |
16 | 16 |
17 class MediaFileTest : public testing::Test { | 17 class MediaFileTest : public testing::Test { |
18 protected: | 18 protected: |
19 void SetUp() { | 19 void SetUp() { |
20 // Use number 0 as the the identifier and pass to CreateMediaFile. | 20 // Use number 0 as the the identifier and pass to CreateMediaFile. |
21 media_file_ = webrtc::MediaFile::CreateMediaFile(0); | 21 media_file_ = webrtc::MediaFile::CreateMediaFile(0); |
22 ASSERT_TRUE(media_file_ != NULL); | 22 ASSERT_TRUE(media_file_ != NULL); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 uint8_t header[kHeaderSize]; | 87 uint8_t header[kHeaderSize]; |
88 ASSERT_EQ(1u, fread(header, kHeaderSize, 1, f)); | 88 ASSERT_EQ(1u, fread(header, kHeaderSize, 1, f)); |
89 EXPECT_EQ(0, memcmp(kExpectedHeader, header, kHeaderSize)); | 89 EXPECT_EQ(0, memcmp(kExpectedHeader, header, kHeaderSize)); |
90 | 90 |
91 uint8_t payload[kPayloadSize]; | 91 uint8_t payload[kPayloadSize]; |
92 ASSERT_EQ(1u, fread(payload, kPayloadSize, 1, f)); | 92 ASSERT_EQ(1u, fread(payload, kPayloadSize, 1, f)); |
93 EXPECT_EQ(0, memcmp(kFakeData, payload, kPayloadSize)); | 93 EXPECT_EQ(0, memcmp(kFakeData, payload, kPayloadSize)); |
94 | 94 |
95 EXPECT_EQ(0, fclose(f)); | 95 EXPECT_EQ(0, fclose(f)); |
96 } | 96 } |
OLD | NEW |