0
0
mirror of https://github.com/monero-project/kovri synced 2025-10-06 00:32:51 +02:00

Tests: add case for setting invalid HTTPResponse code

Referencing #938.
This commit is contained in:
anonimal
2018-07-03 01:25:47 +00:00
parent 6505496a9c
commit 5f7a03539b

View File

@@ -251,4 +251,12 @@ BOOST_AUTO_TEST_CASE(ValidResponse)
// TODO(oneiric): after Boost.Beast refactor, check response follows HTTP protocol
}
BOOST_AUTO_TEST_CASE(InvalidResponse)
{
client::HTTPResponse response(client::HTTPResponse::ok);
BOOST_CHECK_THROW(
response.set(static_cast<client::HTTPResponse::status_t>(12345)),
std::exception);
}
BOOST_AUTO_TEST_SUITE_END()