Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: net/spdy/spdy_protocol_test_utils.cc

Issue 2400463002: Eliminate use of StringPiece(nullptr, n) with non zero n. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_protocol_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol_test_utils.cc
diff --git a/net/spdy/spdy_protocol_test_utils.cc b/net/spdy/spdy_protocol_test_utils.cc
index baa718af0d981ceadadeb1aa48ff425d244964fb..dd600ded2d5a227372b8699cb496f793b42bd87b 100644
--- a/net/spdy/spdy_protocol_test_utils.cc
+++ b/net/spdy/spdy_protocol_test_utils.cc
@@ -48,9 +48,12 @@ namespace test {
return ::testing::AssertionFailure();
if (expected.fin() != actual.fin())
return ::testing::AssertionFailure();
- if (expected.data().size() != actual.data().size())
+ if (expected.data_len() != actual.data_len())
return ::testing::AssertionFailure();
- if (expected.data() != actual.data())
+ if (expected.data() == nullptr && actual.data() != nullptr)
+ return ::testing::AssertionFailure();
+ if (base::StringPiece(expected.data(), expected.data_len()) !=
+ base::StringPiece(actual.data(), actual.data_len()))
return ::testing::AssertionFailure();
if (!VerifySpdyFrameWithPaddingIREquals(expected, actual))
return ::testing::AssertionFailure();
« no previous file with comments | « net/spdy/spdy_protocol_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698