Updated bundled protozero to v1.7.0
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
syntax = "proto2";
|
||||
|
||||
option optimize_for = LITE_RUNTIME;
|
||||
|
||||
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
|
||||
#include <testcase.hpp>
|
||||
|
||||
#include "testcase.pb.h"
|
||||
|
||||
int main(int c, char *argv[]) {
|
||||
int main() {
|
||||
TestFixed32::Test msg;
|
||||
|
||||
msg.set_i(0);
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
|
||||
#include <test.hpp>
|
||||
#include <buffer.hpp>
|
||||
|
||||
#include "t/fixed32/fixed32_testcase.pb.h"
|
||||
|
||||
TEST_CASE("write fixed32 field and check with libprotobuf") {
|
||||
TEMPLATE_TEST_CASE("write fixed32 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()};
|
||||
|
||||
TestFixed32::Test msg;
|
||||
|
||||
SECTION("zero") {
|
||||
pw.add_fixed32(1, 0);
|
||||
|
||||
msg.ParseFromString(buffer);
|
||||
msg.ParseFromArray(buffer.data(), buffer.size());
|
||||
|
||||
REQUIRE(msg.i() == 0);
|
||||
}
|
||||
@@ -21,7 +22,7 @@ TEST_CASE("write fixed32 field and check with libprotobuf") {
|
||||
SECTION("max") {
|
||||
pw.add_fixed32(1, std::numeric_limits<uint32_t>::max());
|
||||
|
||||
msg.ParseFromString(buffer);
|
||||
msg.ParseFromArray(buffer.data(), buffer.size());
|
||||
|
||||
REQUIRE(msg.i() == std::numeric_limits<uint32_t>::max());
|
||||
}
|
||||
@@ -29,7 +30,7 @@ TEST_CASE("write fixed32 field and check with libprotobuf") {
|
||||
SECTION("min") {
|
||||
pw.add_fixed32(1, std::numeric_limits<uint32_t>::min());
|
||||
|
||||
msg.ParseFromString(buffer);
|
||||
msg.ParseFromArray(buffer.data(), buffer.size());
|
||||
|
||||
REQUIRE(msg.i() == std::numeric_limits<uint32_t>::min());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user