Fix QUIC core test display
Tests names will now display a pretty name instead of the test index.
For example new string is:
QuicStreamTests/QuicStreamTest.PendingStreamStaticness/Q048
as opposed to old:
QuicStreamTests/QuicStreamTest.PendingStreamStaticness/33
gfe-relnote: n/a, test-only
PiperOrigin-RevId: 269934211
Change-Id: I44552e9730c57e00a3829f5a15ba10d8af2dc207
diff --git a/quic/core/http/quic_headers_stream_test.cc b/quic/core/http/quic_headers_stream_test.cc
index 2f2db8d..b4bdb28 100644
--- a/quic/core/http/quic_headers_stream_test.cc
+++ b/quic/core/http/quic_headers_stream_test.cc
@@ -162,6 +162,13 @@
Perspective perspective;
};
+// Used by ::testing::PrintToStringParamName().
+std::string PrintToString(const TestParams& tp) {
+ return QuicStrCat(
+ ParsedQuicVersionToString(tp.version), "_",
+ (tp.perspective == Perspective::IS_CLIENT ? "client" : "server"));
+}
+
std::vector<TestParams> GetTestParams() {
std::vector<TestParams> params;
ParsedQuicVersionVector all_supported_versions = AllSupportedVersions();
@@ -374,7 +381,8 @@
// Run all tests with each version and perspective (client or server).
INSTANTIATE_TEST_SUITE_P(Tests,
QuicHeadersStreamTest,
- ::testing::ValuesIn(GetTestParams()));
+ ::testing::ValuesIn(GetTestParams()),
+ ::testing::PrintToStringParamName());
TEST_P(QuicHeadersStreamTest, StreamId) {
EXPECT_EQ(QuicUtils::GetHeadersStreamId(connection_->transport_version()),