Do not directly compare byte outputs of serialized Protocol Buffers.
This CL replaces direct comparison of serialized Protocol Buffer messages with
::testing::EqualsProto. This removes the dependency on the exact format of
serialized messages. For example, instead of string-comparison of two serialized
Protocol Buffer messages, it uses ::testing::EqualsProto against two Protocol
Buffer messages.
=======================================================
EXPECT_EQ(a.SerializeAsString(), b.SerializeAsString()); // Before.
EXPECT_THAT(a, ::testing::EqualsProto(b)); // After.
EXPECT_EQ("thisismyserializedproto", b.SerializeAsString()); // Before
EXPECT_THAT("thisismyserializedproto",
::testing::proto::WhenDeserialized(::testing::EqualsProto(b))); // After
=======================================================
Directly comparing serialized Protocol Buffer messages are not reliable because
Protocol Buffer serialization may vary across software versions, schema changes,
languages, and even within the same program. Using ::testing::EqualsProto
makes the tests more robust. Also, this change ensures that the affected tests
continue to work with any future implementation change in Protocol Buffer
serialization.
PiperOrigin-RevId: 240628307
Change-Id: I7dfd4e1e0b79dedb84603824d3da187fda2e67a9
QUICHE (QUIC, Http/2, Etc) is Google‘s implementation of QUIC and related protocols. It powers Chromium as well as Google’s QUIC servers and some other projects.
The code is currently in process of being moved from https://cs.chromium.org/chromium/src/net/third_party/ into this repository. Please excuse our appearance while we're under construction.