Add a sanity check to the domain socket tests.

rdar://problem/52062631

llvm-svn: 364562
This commit is contained in:
Adrian Prantl 2019-06-27 16:45:23 +00:00
parent 74343eba37
commit 3b4a667854
1 changed files with 5 additions and 1 deletions

View File

@ -93,6 +93,8 @@ TEST_F(SocketTest, DomainListenConnectAccept) {
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
#endif