@@ -31,17 +31,17 @@ class CommunicationTest : public testing::Test {
3131};
3232
3333static void CommunicationReadTest (bool use_read_thread) {
34- auto maybe_socket_pair = Socket::CreatePair ();
35- ASSERT_THAT_EXPECTED (maybe_socket_pair , llvm::Succeeded ());
36- Socket &a = *maybe_socket_pair ->first ;
34+ llvm::Expected<Socket::Pair> pair = Socket::CreatePair ();
35+ ASSERT_THAT_EXPECTED (pair , llvm::Succeeded ());
36+ Socket &a = *pair ->first ;
3737
3838 size_t num_bytes = 4 ;
3939 ASSERT_THAT_ERROR (a.Write (" test" , num_bytes).ToError (), llvm::Succeeded ());
4040 ASSERT_EQ (num_bytes, 4U );
4141
4242 ThreadedCommunication comm (" test" );
43- comm.SetConnection (std::make_unique<ConnectionFileDescriptor>(
44- maybe_socket_pair ->second .release ()));
43+ comm.SetConnection (
44+ std::make_unique<ConnectionFileDescriptor>(pair ->second .release ()));
4545 comm.SetCloseOnEOF (true );
4646
4747 if (use_read_thread) {
@@ -120,13 +120,13 @@ TEST_F(CommunicationTest, ReadThread) {
120120}
121121
122122TEST_F (CommunicationTest, SynchronizeWhileClosing) {
123- auto maybe_socket_pair = Socket::CreatePair ();
124- ASSERT_THAT_EXPECTED (maybe_socket_pair , llvm::Succeeded ());
125- Socket &a = *maybe_socket_pair ->first ;
123+ llvm::Expected<Socket::Pair> pair = Socket::CreatePair ();
124+ ASSERT_THAT_EXPECTED (pair , llvm::Succeeded ());
125+ Socket &a = *pair ->first ;
126126
127127 ThreadedCommunication comm (" test" );
128- comm.SetConnection (std::make_unique<ConnectionFileDescriptor>(
129- maybe_socket_pair ->second .release ()));
128+ comm.SetConnection (
129+ std::make_unique<ConnectionFileDescriptor>(pair ->second .release ()));
130130 comm.SetCloseOnEOF (true );
131131 ASSERT_TRUE (comm.StartReadThread ());
132132
0 commit comments