Merge "Remove unnecessary parameter WriteStringToFile"
This commit is contained in:
committed by
Android (Google) Code Review
commit
885738ffbe
@@ -65,7 +65,7 @@ TEST(IhUtilTest, ParseRecord) {
|
||||
TEST(IhUtilTest, Reader) {
|
||||
TemporaryFile tf;
|
||||
ASSERT_NE(tf.fd, -1);
|
||||
ASSERT_TRUE(WriteStringToFile("test string\nsecond\nooo\n", tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile("test string\nsecond\nooo\n", tf.path));
|
||||
|
||||
Reader r(tf.fd);
|
||||
string line;
|
||||
@@ -82,7 +82,7 @@ TEST(IhUtilTest, Reader) {
|
||||
TEST(IhUtilTest, ReaderSmallBufSize) {
|
||||
TemporaryFile tf;
|
||||
ASSERT_NE(tf.fd, -1);
|
||||
ASSERT_TRUE(WriteStringToFile("test string\nsecond\nooiecccojreo", tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile("test string\nsecond\nooiecccojreo", tf.path));
|
||||
|
||||
Reader r(tf.fd, 5);
|
||||
string line;
|
||||
@@ -99,7 +99,7 @@ TEST(IhUtilTest, ReaderSmallBufSize) {
|
||||
TEST(IhUtilTest, ReaderEmpty) {
|
||||
TemporaryFile tf;
|
||||
ASSERT_NE(tf.fd, -1);
|
||||
ASSERT_TRUE(WriteStringToFile("", tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile("", tf.path));
|
||||
|
||||
Reader r(tf.fd);
|
||||
string line;
|
||||
@@ -112,7 +112,7 @@ TEST(IhUtilTest, ReaderEmpty) {
|
||||
TEST(IhUtilTest, ReaderMultipleEmptyLines) {
|
||||
TemporaryFile tf;
|
||||
ASSERT_NE(tf.fd, -1);
|
||||
ASSERT_TRUE(WriteStringToFile("\n\n", tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile("\n\n", tf.path));
|
||||
|
||||
Reader r(tf.fd);
|
||||
string line;
|
||||
|
||||
@@ -84,7 +84,7 @@ protected:
|
||||
|
||||
TEST_F(FdBufferTest, ReadAndWrite) {
|
||||
std::string testdata = "FdBuffer test string";
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path));
|
||||
ASSERT_EQ(NO_ERROR, buffer.read(tf.fd, READ_TIMEOUT));
|
||||
AssertBufferReadSuccessful(testdata.size());
|
||||
AssertBufferContent(testdata.c_str());
|
||||
@@ -97,7 +97,7 @@ TEST_F(FdBufferTest, IterateEmpty) {
|
||||
|
||||
TEST_F(FdBufferTest, ReadAndIterate) {
|
||||
std::string testdata = "FdBuffer test string";
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path));
|
||||
ASSERT_EQ(NO_ERROR, buffer.read(tf.fd, READ_TIMEOUT));
|
||||
|
||||
int i=0;
|
||||
@@ -137,7 +137,7 @@ TEST_F(FdBufferTest, ReadTimeout) {
|
||||
TEST_F(FdBufferTest, ReadInStreamAndWrite) {
|
||||
std::string testdata = "simply test read in stream";
|
||||
std::string expected = HEAD + testdata;
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path));
|
||||
|
||||
int pid = fork();
|
||||
ASSERT_TRUE(pid != -1);
|
||||
@@ -166,7 +166,7 @@ TEST_F(FdBufferTest, ReadInStreamAndWrite) {
|
||||
TEST_F(FdBufferTest, ReadInStreamAndWriteAllAtOnce) {
|
||||
std::string testdata = "child process flushes only after all data are read.";
|
||||
std::string expected = HEAD + testdata;
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path));
|
||||
|
||||
int pid = fork();
|
||||
ASSERT_TRUE(pid != -1);
|
||||
@@ -196,7 +196,7 @@ TEST_F(FdBufferTest, ReadInStreamAndWriteAllAtOnce) {
|
||||
}
|
||||
|
||||
TEST_F(FdBufferTest, ReadInStreamEmpty) {
|
||||
ASSERT_TRUE(WriteStringToFile("", tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile("", tf.path));
|
||||
|
||||
int pid = fork();
|
||||
ASSERT_TRUE(pid != -1);
|
||||
@@ -260,7 +260,7 @@ TEST_F(FdBufferTest, ReadInStreamMoreThan4MB) {
|
||||
|
||||
TEST_F(FdBufferTest, ReadInStreamTimeOut) {
|
||||
std::string testdata = "timeout test";
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(testdata, tf.path));
|
||||
|
||||
int pid = fork();
|
||||
ASSERT_TRUE(pid != -1);
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
}
|
||||
|
||||
void writeToFdBuffer(string str) {
|
||||
ASSERT_TRUE(WriteStringToFile(str, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(str, tf.path));
|
||||
ASSERT_EQ(NO_ERROR, buffer.read(tf.fd, 10000));
|
||||
ASSERT_EQ(str.size(), buffer.size());
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ TEST(SectionTest, FileSection) {
|
||||
ReportRequestSet requests;
|
||||
|
||||
ASSERT_TRUE(tf.fd != -1);
|
||||
ASSERT_TRUE(WriteStringToFile("iamtestdata", tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile("iamtestdata", tf.path));
|
||||
|
||||
requests.setMainFd(STDOUT_FILENO);
|
||||
|
||||
@@ -173,7 +173,7 @@ TEST(SectionTest, TestFilterPiiTaggedFields) {
|
||||
ReportRequestSet requests;
|
||||
|
||||
ASSERT_TRUE(tf.fd != -1);
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, tf.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, tf.path));
|
||||
|
||||
requests.setMainFd(STDOUT_FILENO);
|
||||
|
||||
@@ -186,7 +186,7 @@ TEST(SectionTest, TestBadFdRequest) {
|
||||
TemporaryFile input;
|
||||
FileSection fs(NOOP_PARSER, input.path);
|
||||
ReportRequestSet requests;
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path));
|
||||
|
||||
IncidentReportArgs args;
|
||||
args.setAll(true);
|
||||
@@ -205,7 +205,7 @@ TEST(SectionTest, TestBadRequests) {
|
||||
TemporaryFile input;
|
||||
FileSection fs(NOOP_PARSER, input.path);
|
||||
ReportRequestSet requests;
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path));
|
||||
|
||||
IncidentReportArgs args;
|
||||
args.setAll(true);
|
||||
@@ -223,7 +223,7 @@ TEST(SectionTest, TestMultipleRequests) {
|
||||
ASSERT_TRUE(output1.fd != -1);
|
||||
ASSERT_TRUE(output2.fd != -1);
|
||||
ASSERT_TRUE(output3.fd != -1);
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path));
|
||||
|
||||
IncidentReportArgs args1, args2, args3;
|
||||
args1.setAll(true);
|
||||
@@ -265,7 +265,7 @@ TEST(SectionTest, TestMultipleRequestsBySpec) {
|
||||
ASSERT_TRUE(output2.fd != -1);
|
||||
ASSERT_TRUE(output3.fd != -1);
|
||||
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path, false));
|
||||
ASSERT_TRUE(WriteStringToFile(VARINT_FIELD_1 + STRING_FIELD_2 + FIX64_FIELD_3, input.path));
|
||||
|
||||
IncidentReportArgs args1, args2, args3, args4;
|
||||
args1.setAll(true);
|
||||
|
||||
Reference in New Issue
Block a user