aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorJOE1994 <joseph942010@gmail.com>2024-09-13 19:34:30 -0400
committerJOE1994 <joseph942010@gmail.com>2024-09-13 19:55:44 -0400
commit459a82e6890ff41e30d486f36c8c7ec22628bb7a (patch)
tree0e607c61c5a5105d3f6126546582a64dee5ca723 /llvm/unittests/Support/VirtualFileSystemTest.cpp
parentc010b72e9b4e3b1ae7467eb86102fc43c338fe19 (diff)
downloadllvm-459a82e6890ff41e30d486f36c8c7ec22628bb7a.zip
llvm-459a82e6890ff41e30d486f36c8c7ec22628bb7a.tar.gz
llvm-459a82e6890ff41e30d486f36c8c7ec22628bb7a.tar.bz2
[llvm][unittests] Don't call raw_string_ostream::flush() (NFC)
raw_string_ostream::flush() is essentially a no-op (also specified in docs). Don't call it in tests that aren't meant to test 'raw_string_ostream' itself. p.s. remove a few redundant calls to raw_string_ostream::str()
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
-rw-r--r--llvm/unittests/Support/VirtualFileSystemTest.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp
index 8d1eb69..eb590e4 100644
--- a/llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ b/llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -2927,7 +2927,6 @@ TEST_F(VFSFromYAMLTest, YAMLVFSWriterTest) {
std::string Buffer;
raw_string_ostream OS(Buffer);
VFSWriter.write(OS);
- OS.flush();
IntrusiveRefCntPtr<ErrorDummyFileSystem> Lower(new ErrorDummyFileSystem());
Lower->addDirectory("//root/");
@@ -2978,7 +2977,6 @@ TEST_F(VFSFromYAMLTest, YAMLVFSWriterTest2) {
std::string Buffer;
raw_string_ostream OS(Buffer);
VFSWriter.write(OS);
- OS.flush();
IntrusiveRefCntPtr<ErrorDummyFileSystem> Lower(new ErrorDummyFileSystem());
IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLRawString(Buffer, Lower);
@@ -3011,7 +3009,6 @@ TEST_F(VFSFromYAMLTest, YAMLVFSWriterTest3) {
std::string Buffer;
raw_string_ostream OS(Buffer);
VFSWriter.write(OS);
- OS.flush();
IntrusiveRefCntPtr<ErrorDummyFileSystem> Lower(new ErrorDummyFileSystem());
IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLRawString(Buffer, Lower);
@@ -3032,7 +3029,6 @@ TEST_F(VFSFromYAMLTest, YAMLVFSWriterTestHandleDirs) {
std::string Buffer;
raw_string_ostream OS(Buffer);
VFSWriter.write(OS);
- OS.flush();
// We didn't add a single file - only directories.
EXPECT_EQ(Buffer.find("'type': 'file'"), std::string::npos);