This source file includes following definitions.
- TEST
#include <string>
#include <vector>
#include "sync/protocol/test.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
TEST(SyncProtobufTest, TestUnknownFields) {
sync_pb::UnknownFieldsTestA a;
sync_pb::UnknownFieldsTestB b;
sync_pb::UnknownFieldsTestB b2;
b.set_foo(true);
b.set_bar(true);
std::string serialized;
ASSERT_TRUE(b.SerializeToString(&serialized));
ASSERT_TRUE(a.ParseFromString(serialized));
ASSERT_TRUE(a.foo());
std::string serialized2;
ASSERT_TRUE(a.SerializeToString(&serialized2));
ASSERT_TRUE(b2.ParseFromString(serialized2));
ASSERT_TRUE(b2.foo());
ASSERT_TRUE(b2.bar());
}
}