aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.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/ErrorTest.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/ErrorTest.cpp')
-rw-r--r--llvm/unittests/Support/ErrorTest.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp
index 16e4865..98d19e8 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -460,13 +460,11 @@ TEST(Error, createStringError) {
EXPECT_EQ(Msg, "foobar10xff\n")
<< "Unexpected createStringError() log result";
- S.flush();
Msg.clear();
logAllUnhandledErrors(createStringError(EC, Bar), S);
EXPECT_EQ(Msg, "bar\n")
<< "Unexpected createStringError() (overloaded) log result";
- S.flush();
Msg.clear();
auto Res = errorToErrorCode(createStringError(EC, "foo%s", Bar));
EXPECT_EQ(Res, EC)