Skip to content

Commit 6698c82

Browse files
author
me
committed
missing REQUIREs
1 parent 9f293b1 commit 6698c82

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

examples/unit_tests/message.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ TEST_SUITE("[MESSAGE]")
116116
http::request req;
117117
std::error_code ec{};
118118
bool finished = http::parser_request{}.parse(req, bad_req, ec);
119+
REQUIRE(!finished);
119120
REQUIRE(ec == http::http_read_bad_method);
120121
}
121122

@@ -131,6 +132,7 @@ TEST_SUITE("[MESSAGE]")
131132
http::request req;
132133
std::error_code ec{};
133134
bool finished = http::parser_request{}.parse(req, bad_req, ec);
135+
REQUIRE(!finished);
134136
REQUIRE(ec == http::http_read_unsupported_http_version);
135137
}
136138

@@ -146,6 +148,7 @@ TEST_SUITE("[MESSAGE]")
146148
http::request req;
147149
std::error_code ec{};
148150
bool finished = http::parser_request{}.parse(req, bad_req, ec);
151+
REQUIRE(!finished);
149152
REQUIRE(ec == http::http_read_unsupported_http_version);
150153
}
151154

@@ -161,6 +164,7 @@ TEST_SUITE("[MESSAGE]")
161164
http::request req;
162165
std::error_code ec{};
163166
bool finished = http::parser_request{}.parse(req, bad_req, ec);
167+
REQUIRE(!finished);
164168
REQUIRE(ec == http::http_read_unsupported_http_version);
165169
}
166170

@@ -176,6 +180,7 @@ TEST_SUITE("[MESSAGE]")
176180
http::request req;
177181
std::error_code ec{};
178182
bool finished = http::parser_request{}.parse(req, bad_req, ec);
183+
REQUIRE(!finished);
179184
REQUIRE(ec == http::http_read_header_kv_delimiter_not_found);
180185
}
181186

@@ -192,6 +197,7 @@ TEST_SUITE("[MESSAGE]")
192197
http::request req;
193198
std::error_code ec{};
194199
bool finished = http::parser_request{}.parse(req, bad_req, ec);
200+
REQUIRE(!finished);
195201
REQUIRE(ec == http::http_read_header_unsupported_field); // (It should be "Host:" not "Host :")
196202
}
197203

@@ -259,6 +265,7 @@ TEST_SUITE("[MESSAGE]")
259265
http::response reply;
260266
std::error_code ec{};
261267
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
268+
REQUIRE(!finished);
262269
REQUIRE(ec == http::http_read_unsupported_http_version);
263270
}
264271

@@ -273,6 +280,7 @@ TEST_SUITE("[MESSAGE]")
273280
http::response reply;
274281
std::error_code ec{};
275282
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
283+
REQUIRE(!finished);
276284
REQUIRE(ec == http::http_read_unsupported_http_version);
277285
}
278286

@@ -287,6 +295,7 @@ TEST_SUITE("[MESSAGE]")
287295
http::response reply;
288296
std::error_code ec{};
289297
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
298+
REQUIRE(!finished);
290299
REQUIRE(ec == http::http_read_unsupported_http_version);
291300
}
292301

@@ -301,6 +310,7 @@ TEST_SUITE("[MESSAGE]")
301310
http::response reply;
302311
std::error_code ec{};
303312
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
313+
REQUIRE(!finished);
304314
REQUIRE(ec == http::http_read_bad_status);
305315
}
306316

@@ -315,6 +325,7 @@ TEST_SUITE("[MESSAGE]")
315325
http::response reply;
316326
std::error_code ec{};
317327
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
328+
REQUIRE(!finished);
318329
REQUIRE(ec == http::http_read_header_kv_delimiter_not_found);
319330
}
320331

@@ -329,6 +340,7 @@ TEST_SUITE("[MESSAGE]")
329340
http::response reply;
330341
std::error_code ec{};
331342
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
343+
REQUIRE(!finished);
332344
REQUIRE(ec == http::http_read_header_unsupported_field);
333345
}
334346

@@ -343,6 +355,7 @@ TEST_SUITE("[MESSAGE]")
343355
http::response reply;
344356
std::error_code ec{};
345357
bool finished = http::parser_response{}.parse(reply, bad_reply, ec);
358+
REQUIRE(!finished);
346359
REQUIRE(ec == http::http_read_header_unsupported_field);
347360
}
348361

0 commit comments

Comments
 (0)