Updated bundled protozero to v1.7.0

This commit is contained in:
Denis Chaplygin
2020-10-16 10:25:52 +03:00
parent df3ed43d70
commit a8362d75b5
126 changed files with 18489 additions and 11079 deletions
@@ -1,3 +1,4 @@
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
+1 -1
View File
@@ -51,7 +51,7 @@ TEST_CASE("read bytes field: end of buffer") {
for (std::string::size_type i = 1; i < buffer.size(); ++i) {
protozero::pbf_reader item{buffer.data(), i};
REQUIRE(item.next());
REQUIRE_THROWS_AS(item.get_bytes(), const protozero::end_of_buffer_exception&);
REQUIRE_THROWS_AS(item.get_bytes(), protozero::end_of_buffer_exception);
}
}
+2 -1
View File
@@ -1,8 +1,9 @@
#include <testcase.hpp>
#include "testcase.pb.h"
int main(int c, char *argv[]) {
int main() {
TestBytes::Test msg;
msg.set_s("");
+9 -8
View File
@@ -1,19 +1,20 @@
#include <test.hpp>
#include <buffer.hpp>
#include "t/bytes/bytes_testcase.pb.h"
TEST_CASE("write bytes field and check with libprotobuf") {
TEMPLATE_TEST_CASE("write bytes field and check with libprotobuf", "",
buffer_test_string, buffer_test_vector, buffer_test_array, buffer_test_external) {
std::string buffer;
protozero::pbf_writer pw{buffer};
TestType buffer;
typename TestType::writer_type pw{buffer.buffer()};
TestBytes::Test msg;
SECTION("empty") {
pw.add_string(1, "");
msg.ParseFromString(buffer);
msg.ParseFromArray(buffer.data(), buffer.size());
REQUIRE(msg.s().empty());
}
@@ -21,7 +22,7 @@ TEST_CASE("write bytes field and check with libprotobuf") {
SECTION("one") {
pw.add_string(1, "x");
msg.ParseFromString(buffer);
msg.ParseFromArray(buffer.data(), buffer.size());
REQUIRE(msg.s() == "x");
}
@@ -29,7 +30,7 @@ TEST_CASE("write bytes field and check with libprotobuf") {
SECTION("string") {
pw.add_string(1, "foobar");
msg.ParseFromString(buffer);
msg.ParseFromArray(buffer.data(), buffer.size());
REQUIRE(msg.s() == "foobar");
}
@@ -42,7 +43,7 @@ TEST_CASE("write bytes field and check with libprotobuf") {
pw.add_string(1, data);
msg.ParseFromString(buffer);
msg.ParseFromArray(buffer.data(), buffer.size());
REQUIRE(msg.s().size() == 3);
REQUIRE(msg.s()[1] == char(2));