| 69 | }; |
| 70 | |
| 71 | TEST(Net, TCPRequest) |
| 72 | { |
| 73 | TcpHandle handler; |
| 74 | |
| 75 | handler.mSocket = NetSocket::INVALID; |
| 76 | handler.mDataReceived = 0; |
| 77 | |
| 78 | // Hook into the signals. |
| 79 | Net::smConnectionNotify ->notify(&handler, &TcpHandle::notify); |
| 80 | Net::smConnectionReceive->notify(&handler, &TcpHandle::receive); |
| 81 | |
| 82 | // Open a TCP connection to garagegames.com |
| 83 | handler.mSocket = Net::openConnectTo("72.246.107.193:80"); |
| 84 | const U32 limit = Platform::getRealMilliseconds() + (5*1000); |
| 85 | while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {} |
| 86 | |
| 87 | // Unhook from the signals. |
| 88 | Net::smConnectionNotify ->remove(&handler, &TcpHandle::notify); |
| 89 | Net::smConnectionReceive->remove(&handler, &TcpHandle::receive); |
| 90 | |
| 91 | EXPECT_GT(handler.mDataReceived, 0) |
| 92 | << "Didn't get any data back!"; |
| 93 | } |
| 94 | |
| 95 | struct JournalHandle |
| 96 | { |
nothing calls this directly
no test coverage detected