commit | b1a32ae79f953e21267960e6e05cdd04cb9944e6 | [log] [tgz] |
---|---|---|
author | QUICHE team <quiche-dev@google.com> | Wed Mar 27 13:24:21 2019 -0700 |
committer | Bence Béky <bnc@google.com> | Fri Mar 29 11:47:31 2019 +0000 |
tree | 5bb924e097e87ab23803d22759e2821c2358db87 | |
parent | 5988293d0494cd3dda59c0ef2147cdb2cf63ee75 [diff] |
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.