[Lldb-commits] [PATCH] D50027: Added initial unit test for LLDB's Stream class.

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 31 16:03:52 PDT 2018

teemperor added inline comments.

Comment at: unittests/Utility/StreamTest.cpp:38-41
+TEST_F(StreamTest, ChangingByteOrder) {
+  s.SetByteOrder(lldb::eByteOrderPDP);
+  EXPECT_EQ(lldb::eByteOrderPDP, s.GetByteOrder());
labath wrote:
> <musing> I've been wondering for a while whether we shouldn't just remove PDP byte order support. Most of our code doesn't really support it, and neither does llvm's, so this is kind of a prerequisite for switching to llvm streams. </musing>
I support this notion.  think most of LLDB's algorithms do not respect PDP ordering.

Comment at: unittests/Utility/StreamTest.cpp:56
+  s.PutChar('\n');
+  EXPECT_EQ(" \n", Value());
labath wrote:
> How do you feel about changing `Value` to call `Clear` on the underlying StreamString after fetching the string (and maybe renaming it to `TakeValue` or something)? That way, you could easily test the string printed by a specific function, instead of having to accumulate the expectations.
Sounds good to me, makes it definitely more readable.


More information about the lldb-commits mailing list