[Lldb-commits] [PATCH] D49307: Fix some crashes and deadlocks in FormatAnsiTerminalCodes

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 16 04:14:26 PDT 2018


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

This looks straight-forward enough.



================
Comment at: unittests/Utility/AnsiTerminalTest.cpp:18
+  std::string format = ansi::FormatAnsiTerminalCodes("");
+  EXPECT_STREQ("", format.c_str());
+}
----------------
I would suggest getting rid of the temporary `format` variable. That way, if this assertion fails, the error message will immediately tell you what the failing command was.
(you can also use `EXPECT_EQ` here as `operator==` will do the right thing when one of the arguments is a std::string)


https://reviews.llvm.org/D49307





More information about the lldb-commits mailing list