Fix tests

This commit is contained in:
Fred Nicolson 2019-01-14 13:38:35 +00:00
parent 16ee36f5d2
commit 1ccde3f324

View File

@ -8,25 +8,14 @@
TEST(SocketTest, status_to_string_valid) TEST(SocketTest, status_to_string_valid)
{ {
ASSERT_EQ(fr::Socket::status_to_string(fr::Socket::Status::Unknown), "Unknown"); ASSERT_EQ(fr::Socket::status_to_string(fr::Socket::Status::Unknown), "Unknown");
ASSERT_EQ(fr::Socket::status_to_string(fr::Socket::Status::HttpBodyTooBig), "HTTP body too big"); ASSERT_EQ(fr::Socket::status_to_string(fr::Socket::Status::HttpBodyTooBig), "HTTP Body Too Big");
} }
TEST(SocketTest, status_to_string_invalid) TEST(SocketTest, status_to_string_invalid)
{ {
try
{ auto str = fr::Socket::status_to_string(static_cast<fr::Socket::Status>(-1));
auto str = fr::Socket::status_to_string(static_cast<fr::Socket::Status>(-1)); ASSERT_EQ(str, "Unknown");
} str = fr::Socket::status_to_string(static_cast<fr::Socket::Status>(99999));
catch(const std::logic_error &) ASSERT_EQ(str, "Unknown");
{
try
{
auto str = fr::Socket::status_to_string(static_cast<fr::Socket::Status>(99999));
}
catch(const std::logic_error &)
{
return;
}
}
ASSERT_TRUE(false);
} }