| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "webrtc/base/arraysize.h" | 13 #include "webrtc/rtc_base/arraysize.h" |
| 14 #include "webrtc/base/checks.h" | 14 #include "webrtc/rtc_base/checks.h" |
| 15 #include "webrtc/base/filerotatingstream.h" | 15 #include "webrtc/rtc_base/filerotatingstream.h" |
| 16 #include "webrtc/base/fileutils.h" | 16 #include "webrtc/rtc_base/fileutils.h" |
| 17 #include "webrtc/base/gunit.h" | 17 #include "webrtc/rtc_base/gunit.h" |
| 18 #include "webrtc/base/pathutils.h" | 18 #include "webrtc/rtc_base/pathutils.h" |
| 19 #include "webrtc/test/testsupport/fileutils.h" | 19 #include "webrtc/test/testsupport/fileutils.h" |
| 20 | 20 |
| 21 namespace rtc { | 21 namespace rtc { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 void CleanupLogDirectory(const FileRotatingStream& stream) { | 25 void CleanupLogDirectory(const FileRotatingStream& stream) { |
| 26 for (size_t i = 0; i < stream.GetNumFiles(); ++i) { | 26 for (size_t i = 0; i < stream.GetNumFiles(); ++i) { |
| 27 // Ignore return value, not all files are expected to exist. | 27 // Ignore return value, not all files are expected to exist. |
| 28 webrtc::test::RemoveFile(stream.GetFilePath(i)); | 28 webrtc::test::RemoveFile(stream.GetFilePath(i)); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 for (size_t i = 0; i < arraysize(expected_vals); ++i) { | 336 for (size_t i = 0; i < arraysize(expected_vals); ++i) { |
| 337 memset(expected_buffer.get(), expected_vals[i], buffer_size); | 337 memset(expected_buffer.get(), expected_vals[i], buffer_size); |
| 338 EXPECT_EQ(SR_SUCCESS, | 338 EXPECT_EQ(SR_SUCCESS, |
| 339 stream_->ReadAll(buffer.get(), buffer_size, nullptr, nullptr)); | 339 stream_->ReadAll(buffer.get(), buffer_size, nullptr, nullptr)); |
| 340 EXPECT_EQ(0, memcmp(buffer.get(), expected_buffer.get(), buffer_size)); | 340 EXPECT_EQ(0, memcmp(buffer.get(), expected_buffer.get(), buffer_size)); |
| 341 } | 341 } |
| 342 EXPECT_EQ(SR_EOS, stream_->ReadAll(buffer.get(), 1, nullptr, nullptr)); | 342 EXPECT_EQ(SR_EOS, stream_->ReadAll(buffer.get(), 1, nullptr, nullptr)); |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace rtc | 345 } // namespace rtc |
| OLD | NEW |