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
1 file changed
tree: 5bb924e097e87ab23803d22759e2821c2358db87
  1. http2/
  2. quic/
  3. spdy/
  4. CONTRIBUTING.md
  5. LICENSE
  6. README.md
README.md

QUICHE

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.