@@ -91,7 +91,7 @@ struct UpgraderSemiMock : public Upgrader {
91
91
92
92
void upgradeToMuxed (SecSPtr conn, OnMuxedCallbackFunc cb) override {
93
93
mux->muxConnection (std::move (conn), [cb = std::move (cb)](auto &&conn_res) {
94
- auto conn = EXPECT_OK ( conn_res);
94
+ ASSERT_OUTCOME_SUCCESS ( conn, conn_res);
95
95
cb (std::move (conn));
96
96
});
97
97
}
@@ -111,7 +111,7 @@ struct Server : public std::enable_shared_from_this<Server> {
111
111
112
112
conn->onStream (
113
113
[this , conn](outcome::result<std::shared_ptr<Stream>> rstream) {
114
- auto stream = EXPECT_OK ( rstream);
114
+ ASSERT_OUTCOME_SUCCESS ( stream, rstream);
115
115
this ->println (" new stream created" );
116
116
this ->streamsCreated ++;
117
117
auto buf = std::make_shared<std::vector<uint8_t >>();
@@ -136,7 +136,7 @@ struct Server : public std::enable_shared_from_this<Server> {
136
136
this ->println (fmt::format (" readSome error: {}" , rread.error ()));
137
137
}
138
138
139
- auto read = EXPECT_OK ( rread);
139
+ ASSERT_OUTCOME_SUCCESS ( read , rread);
140
140
141
141
this ->println (" readSome " , read , " bytes" );
142
142
if (read == 0 ) {
@@ -150,7 +150,7 @@ struct Server : public std::enable_shared_from_this<Server> {
150
150
stream,
151
151
*buf,
152
152
[buf, read , stream, this ](outcome::result<size_t > rwrite) {
153
- auto write = EXPECT_OK ( rwrite);
153
+ ASSERT_OUTCOME_SUCCESS ( write , rwrite);
154
154
this ->println (" write " , write , " bytes" );
155
155
this ->streamWrites ++;
156
156
ASSERT_EQ (write , read );
@@ -163,12 +163,12 @@ struct Server : public std::enable_shared_from_this<Server> {
163
163
void listen (const Multiaddress &ma) {
164
164
listener_ = transport_->createListener (
165
165
[this ](outcome::result<std::shared_ptr<CapableConnection>> rconn) {
166
- auto conn = EXPECT_OK ( rconn);
166
+ ASSERT_OUTCOME_SUCCESS ( conn, rconn);
167
167
this ->println (" new connection received" );
168
168
this ->onConnection (conn);
169
169
});
170
170
171
- EXPECT_OK (this ->listener_ ->listen (ma));
171
+ ASSERT_OUTCOME_SUCCESS (this ->listener_ ->listen (ma));
172
172
}
173
173
174
174
size_t clientsConnected = 0 ;
@@ -210,7 +210,7 @@ struct Client : public std::enable_shared_from_this<Client> {
210
210
p,
211
211
server,
212
212
[this ](outcome::result<std::shared_ptr<CapableConnection>> rconn) {
213
- auto conn = EXPECT_OK ( rconn);
213
+ ASSERT_OUTCOME_SUCCESS ( conn, rconn);
214
214
conn->start ();
215
215
this ->println (" connected" );
216
216
this ->onConnection (conn);
@@ -222,7 +222,7 @@ struct Client : public std::enable_shared_from_this<Client> {
222
222
boost::asio::post (*context_, [i, conn, this ]() {
223
223
conn->newStream (
224
224
[i, conn, this ](outcome::result<std::shared_ptr<Stream>> rstream) {
225
- auto stream = EXPECT_OK ( rstream);
225
+ ASSERT_OUTCOME_SUCCESS ( stream, rstream);
226
226
this ->println (" new stream number " , i, " created" );
227
227
this ->onStream (i, this ->rounds_ , stream);
228
228
});
@@ -248,7 +248,7 @@ struct Client : public std::enable_shared_from_this<Client> {
248
248
stream,
249
249
*buf,
250
250
[round , streamId, buf, stream, this ](outcome::result<size_t > rwrite) {
251
- auto write = EXPECT_OK ( rwrite);
251
+ ASSERT_OUTCOME_SUCCESS ( write , rwrite);
252
252
this ->println (streamId, " write " , write , " bytes" );
253
253
this ->streamWrites ++;
254
254
@@ -259,7 +259,7 @@ struct Client : public std::enable_shared_from_this<Client> {
259
259
readbuf->size (),
260
260
[round , streamId, write , buf, readbuf, stream, this ](
261
261
outcome::result<size_t > rread) {
262
- auto read = EXPECT_OK ( rread);
262
+ ASSERT_OUTCOME_SUCCESS ( read , rread);
263
263
this ->println (streamId, " readSome " , read , " bytes" );
264
264
this ->streamReads ++;
265
265
@@ -437,9 +437,9 @@ TEST_P(MuxerAcceptanceTest, ParallelEcho) {
437
437
auto client = std::make_shared<Client>(
438
438
transport, localSeed, context, streams, rounds);
439
439
440
- auto marshalled_key =
441
- EXPECT_OK ( key_marshaller->marshal (serverKeyPair.publicKey ));
442
- auto p = EXPECT_OK ( PeerId::fromPublicKey (marshalled_key));
440
+ ASSERT_OUTCOME_SUCCESS (
441
+ marshalled_key, key_marshaller->marshal (serverKeyPair.publicKey ));
442
+ ASSERT_OUTCOME_SUCCESS (p, PeerId::fromPublicKey (marshalled_key));
443
443
client->connect (p, serverAddr);
444
444
445
445
context->run_for (10000ms);
0 commit comments