Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: webrtc/base/filerotatingstream_unittest.cc

Issue 1245143005: Remove CircularFileStream / replace it with CallSessionFileRotatingStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add GetSize to FileRotatingStream Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/filerotatingstream.cc ('k') | webrtc/base/logsinks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/filerotatingstream_unittest.cc
diff --git a/webrtc/base/filerotatingstream_unittest.cc b/webrtc/base/filerotatingstream_unittest.cc
index 084c61244c8399a0f8103f720b0f7971460d6e4e..09438f870eec034df71b6c84f2ed261e50b31d5c 100644
--- a/webrtc/base/filerotatingstream_unittest.cc
+++ b/webrtc/base/filerotatingstream_unittest.cc
@@ -60,11 +60,15 @@ class FileRotatingStreamTest : public ::testing::Test {
scoped_ptr<FileRotatingStream> stream;
stream.reset(new FileRotatingStream(dir_path, file_prefix));
ASSERT_TRUE(stream->Open());
+ size_t read = 0;
+ size_t stream_size = 0;
+ EXPECT_TRUE(stream->GetSize(&stream_size));
scoped_ptr<uint8_t[]> buffer(new uint8_t[expected_length]);
EXPECT_EQ(SR_SUCCESS,
- stream->ReadAll(buffer.get(), expected_length, nullptr, nullptr));
+ stream->ReadAll(buffer.get(), expected_length, &read, nullptr));
EXPECT_EQ(0, memcmp(expected_contents, buffer.get(), expected_length));
EXPECT_EQ(SR_EOS, stream->ReadAll(buffer.get(), 1, nullptr, nullptr));
+ EXPECT_EQ(stream_size, read);
}
void VerifyFileContents(const char* expected_contents,
@@ -214,11 +218,15 @@ class CallSessionFileRotatingStreamTest : public ::testing::Test {
scoped_ptr<CallSessionFileRotatingStream> stream(
new CallSessionFileRotatingStream(dir_path));
ASSERT_TRUE(stream->Open());
+ size_t read = 0;
+ size_t stream_size = 0;
+ EXPECT_TRUE(stream->GetSize(&stream_size));
scoped_ptr<uint8_t[]> buffer(new uint8_t[expected_length]);
EXPECT_EQ(SR_SUCCESS,
- stream->ReadAll(buffer.get(), expected_length, nullptr, nullptr));
+ stream->ReadAll(buffer.get(), expected_length, &read, nullptr));
EXPECT_EQ(0, memcmp(expected_contents, buffer.get(), expected_length));
EXPECT_EQ(SR_EOS, stream->ReadAll(buffer.get(), 1, nullptr, nullptr));
+ EXPECT_EQ(stream_size, read);
}
scoped_ptr<CallSessionFileRotatingStream> stream_;
« no previous file with comments | « webrtc/base/filerotatingstream.cc ('k') | webrtc/base/logsinks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698