diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestSelective.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestSelective.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/unittests/Format/FormatTestSelective.cpp b/clang/unittests/Format/FormatTestSelective.cpp index c4286d4297d..2bc60fd1e0d 100644 --- a/clang/unittests/Format/FormatTestSelective.cpp +++ b/clang/unittests/Format/FormatTestSelective.cpp @@ -28,10 +28,10 @@ protected: tooling::Replacements Replaces = reformat(Style, Code, Ranges, "<stdin>", &IncompleteFormat); EXPECT_FALSE(IncompleteFormat) << Code << "\n\n"; - std::string Result = applyAllReplacements(Code, Replaces); - EXPECT_NE("", Result); - DEBUG(llvm::errs() << "\n" << Result << "\n\n"); - return Result; + auto Result = applyAllReplacements(Code, Replaces); + EXPECT_TRUE(static_cast<bool>(Result)); + DEBUG(llvm::errs() << "\n" << *Result << "\n\n"); + return *Result; } FormatStyle Style = getLLVMStyle(); |