Beispiel #1
0
inline void check_empty(protozero::pbf_reader message) {
    while (message.next()) {
        switch (message.tag()) {
            case 1: {
                REQUIRE(!message.get_message().next());
                break;
            }
            case 2: {
                REQUIRE(77 == message.get_int32());
                break;
            }
            default: {
                REQUIRE(false); // should never be here
                break;
            }
        }
    }
}
Beispiel #2
0
inline void check_subsub(protozero::pbf_reader message) {
    while (message.next()) {
        switch (message.tag()) {
            case 1: {
                REQUIRE("foobar" == message.get_string());
                break;
            }
            case 2: {
                REQUIRE(99 == message.get_int32());
                break;
            }
            default: {
                REQUIRE(false); // should never be here
                break;
            }
        }
    }
}