diff options
author | Wei Wang <wvw@google.com> | 2017-11-09 21:45:29 -0800 |
---|---|---|
committer | Wei Wang <wvw@google.com> | 2017-11-10 17:32:25 +0000 |
commit | 254102d858942393482589b8f1e6102b33797b58 (patch) | |
tree | 406b3d2a0049994d9b496770f7860536f48b566c | |
parent | 5bb66e73ec479a34ee58f06feccf1d7db4677f3e (diff) |
Remove unnecessary parameter WriteStringToFile
By default, WriteStringToFile will not follow link, the 'false'
parameter is unnecessary.
Test: build
Change-Id: Ied6dcbf2a85533108dc2f6d71a4571b44684e800
-rw-r--r-- | cmds/incident_helper/tests/ih_util_test.cpp | 8 | ||||
-rw-r--r-- | cmds/incidentd/tests/FdBuffer_test.cpp | 12 | ||||
-rw-r--r-- | cmds/incidentd/tests/PrivacyBuffer_test.cpp | 2 | ||||
-rw-r--r-- | cmds/incidentd/tests/Section_test.cpp | 12 |
4 files changed, 17 insertions, 17 deletions
diff --git a/cmds/incident_helper/tests/ih_util_test.cpp b/cmds/incident_helper/tests/ih_util_test.cpp index da88ee3a0120..3cef6b378ee1 100644 --- a/cmds/incident_helper/tests/ih_util_test.cpp +++ b/cmds/incident_helper/tests/ih_util_test.cpp @@ -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; diff --git a/cmds/incidentd/tests/FdBuffer_test.cpp b/cmds/incidentd/tests/FdBuffer_test.cpp index 2afa778b734c..3fd2ed82a26e 100644 --- a/cmds/incidentd/tests/FdBuffer_test.cpp +++ b/cmds/incidentd/tests/FdBuffer_test.cpp @@ -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); diff --git a/cmds/incidentd/tests/PrivacyBuffer_test.cpp b/cmds/incidentd/tests/PrivacyBuffer_test.cpp index 84a2a825b4c3..ca9462394493 100644 --- a/cmds/incidentd/tests/PrivacyBuffer_test.cpp +++ b/cmds/incidentd/tests/PrivacyBuffer_test.cpp @@ -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()); } diff --git a/cmds/incidentd/tests/Section_test.cpp b/cmds/incidentd/tests/Section_test.cpp index 25b05b2b1518..649e908a83c4 100644 --- a/cmds/incidentd/tests/Section_test.cpp +++ b/cmds/incidentd/tests/Section_test.cpp @@ -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); |