MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / run

Method run

source/test/universe_connection_test.cpp:73–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 virtual void run() {
74 try {
75 for (unsigned i = 0; i < PacketCount; ++i) {
76 m_connection.pushSingle(make_shared<ProtocolRequestPacket>(i));
77 EXPECT_TRUE(m_connection.sendAll(SyncWaitMillis));
78 EXPECT_TRUE(m_connection.receiveAny(SyncWaitMillis));
79 EXPECT_EQ(convert<ProtocolRequestPacket>(m_connection.pullSingle())->requestProtocolVersion, i);
80
81 if (!m_connection.isOpen())
82 break;
83 }
84
85 m_connection.close();
86 EXPECT_TRUE(m_connection.pull().empty());
87 } catch (std::exception const& e) {
88 ADD_FAILURE() << "Exception: " << outputException(e, true);
89 } catch (...) {
90 ADD_FAILURE();
91 }
92 }
93
94private:
95 UniverseConnection m_connection;

Callers

nothing calls this directly

Calls 9

pushSingleMethod · 0.80
sendAllMethod · 0.80
receiveAnyMethod · 0.80
pullSingleMethod · 0.80
pullMethod · 0.80
outputExceptionFunction · 0.50
isOpenMethod · 0.45
closeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected