osrm-backend/test/unit/test_exceptions.cpp
Michael Krasnyk 68019a1fb2 Squashed 'third_party/protozero/' content from commit d5d8debf1
git-subtree-dir: third_party/protozero
git-subtree-split: d5d8debf1b17c6bb652395957b76cde7787e5377
2018-04-19 22:03:49 +03:00

34 lines
1.1 KiB
C++

#include <test.hpp>
TEST_CASE("exceptions messages for pbf exception") {
protozero::exception e;
REQUIRE(std::string{e.what()} == std::string{"pbf exception"});
}
TEST_CASE("exceptions messages for varint too long") {
protozero::varint_too_long_exception e;
REQUIRE(std::string{e.what()} == std::string{"varint too long exception"});
}
TEST_CASE("exceptions messages for unknown pbf field type") {
protozero::unknown_pbf_wire_type_exception e;
REQUIRE(std::string{e.what()} == std::string{"unknown pbf field type exception"});
}
TEST_CASE("exceptions messages for end of buffer") {
protozero::end_of_buffer_exception e;
REQUIRE(std::string{e.what()} == std::string{"end of buffer exception"});
}
TEST_CASE("exceptions messages for invalid tag") {
protozero::invalid_tag_exception e;
REQUIRE(std::string{e.what()} == std::string{"invalid tag exception"});
}
TEST_CASE("exceptions messages for invalid length") {
protozero::invalid_length_exception e;
REQUIRE(std::string{e.what()} == std::string{"invalid length exception"});
}