File: test_exceptions.cpp

package info (click to toggle)
protozero 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,548 kB
  • sloc: cpp: 20,364; sh: 18; makefile: 14
file content (33 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#include <test.hpp>

TEST_CASE("exceptions messages for pbf exception") {
    const protozero::exception e;
    REQUIRE(std::string{e.what()} == std::string{"pbf exception"});
}

TEST_CASE("exceptions messages for varint too long") {
    const 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") {
    const 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") {
    const protozero::end_of_buffer_exception e;
    REQUIRE(std::string{e.what()} == std::string{"end of buffer exception"});
}

TEST_CASE("exceptions messages for invalid tag") {
    const protozero::invalid_tag_exception e;
    REQUIRE(std::string{e.what()} == std::string{"invalid tag exception"});
}

TEST_CASE("exceptions messages for invalid length") {
    const protozero::invalid_length_exception e;
    REQUIRE(std::string{e.what()} == std::string{"invalid length exception"});
}