MCPcopy Create free account
hub / github.com/aria2/aria2 / setUp

Method setUp

test/FtpConnectionTest.cc:48–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47public:
48 void setUp()
49 {
50 option_.reset(new Option());
51 authConfigFactory_.reset(new AuthConfigFactory());
52
53 //_ftpServerSocket.reset(new SocketCore());
54 std::shared_ptr<SocketCore> listenSocket(new SocketCore());
55 listenSocket->bind(0);
56 listenSocket->beginListen();
57 listenSocket->setBlockingMode();
58 listenPort_ = listenSocket->getAddrInfo().port;
59
60 req_.reset(new Request());
61 req_->setUri("ftp://localhost/dir%20sp/hello%20world.img");
62
63 clientSocket_.reset(new SocketCore());
64 clientSocket_->establishConnection("localhost", listenPort_);
65
66 while (!clientSocket_->isWritable(0))
67 ;
68
69 serverSocket_ = listenSocket->acceptConnection();
70 serverSocket_->setBlockingMode();
71 ftp_.reset(new FtpConnection(
72 1, clientSocket_, req_,
73 authConfigFactory_->createAuthConfig(req_, option_.get()),
74 option_.get()));
75 }
76
77 void tearDown() {}
78

Callers

nothing calls this directly

Calls 11

beginListenMethod · 0.80
setBlockingModeMethod · 0.80
getAddrInfoMethod · 0.80
setUriMethod · 0.80
establishConnectionMethod · 0.80
isWritableMethod · 0.80
acceptConnectionMethod · 0.80
createAuthConfigMethod · 0.80
resetMethod · 0.45
bindMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected