[Lldb-commits] [lldb] r364562 - Add a sanity check to the domain socket tests.
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 27 09:45:23 PDT 2019
Author: adrian
Date: Thu Jun 27 09:45:23 2019
New Revision: 364562
URL: http://llvm.org/viewvc/llvm-project?rev=364562&view=rev
Log:
Add a sanity check to the domain socket tests.
rdar://problem/52062631
Modified:
lldb/trunk/unittests/Host/SocketTest.cpp
Modified: lldb/trunk/unittests/Host/SocketTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=364562&r1=364561&r2=364562&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/SocketTest.cpp (original)
+++ lldb/trunk/unittests/Host/SocketTest.cpp Thu Jun 27 09:45:23 2019
@@ -93,6 +93,8 @@ TEST_F(SocketTest, DomainListenConnectAc
std::error_code EC = llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
ASSERT_FALSE(EC);
llvm::sys::path::append(Path, "test");
+ // If this fails, $TMPDIR is too long to hold a domain socket.
+ EXPECT_LE(Path.size(), 107u);
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
@@ -194,6 +196,8 @@ TEST_F(SocketTest, DomainGetConnectURI)
llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", domain_path);
ASSERT_FALSE(EC);
llvm::sys::path::append(domain_path, "test");
+ // If this fails, $TMPDIR is too long to hold a domain socket.
+ EXPECT_LE(domain_path.size(), 107u);
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
@@ -208,4 +212,4 @@ TEST_F(SocketTest, DomainGetConnectURI)
EXPECT_EQ(scheme, "unix-connect");
EXPECT_EQ(path, domain_path);
}
-#endif
\ No newline at end of file
+#endif
More information about the lldb-commits
mailing list