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

Unified Diff: net/quic/crypto/null_decrypter_test.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/quic/crypto/null_decrypter.cc ('k') | net/quic/crypto/null_encrypter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/null_decrypter_test.cc
diff --git a/net/quic/crypto/null_decrypter_test.cc b/net/quic/crypto/null_decrypter_test.cc
index 173ecdeac6553cc1f1d9c8421c2c4fd4343df940..4c8bae4ff5f6373047acd08e97c37d8dbc4c90da 100644
--- a/net/quic/crypto/null_decrypter_test.cc
+++ b/net/quic/crypto/null_decrypter_test.cc
@@ -26,10 +26,12 @@ TEST_F(NullDecrypterTest, Decrypt) {
const char* data = reinterpret_cast<const char*>(expected);
size_t len = arraysize(expected);
NullDecrypter decrypter;
- scoped_ptr<QuicData> decrypted(
- decrypter.DecryptPacket(0, "hello world!", StringPiece(data, len)));
- ASSERT_TRUE(decrypted.get());
- EXPECT_EQ("goodbye!", decrypted->AsStringPiece());
+ char buffer[256];
+ size_t length = 0;
+ ASSERT_TRUE(decrypter.DecryptPacket(0, "hello world!", StringPiece(data, len),
+ buffer, &length, 256));
+ EXPECT_LT(0u, length);
+ EXPECT_EQ("goodbye!", StringPiece(buffer, length));
}
TEST_F(NullDecrypterTest, BadHash) {
@@ -45,9 +47,10 @@ TEST_F(NullDecrypterTest, BadHash) {
const char* data = reinterpret_cast<const char*>(expected);
size_t len = arraysize(expected);
NullDecrypter decrypter;
- scoped_ptr<QuicData> decrypted(
- decrypter.DecryptPacket(0, "hello world!", StringPiece(data, len)));
- ASSERT_FALSE(decrypted.get());
+ char buffer[256];
+ size_t length = 0;
+ ASSERT_FALSE(decrypter.DecryptPacket(
+ 0, "hello world!", StringPiece(data, len), buffer, &length, 256));
}
TEST_F(NullDecrypterTest, ShortInput) {
@@ -60,9 +63,10 @@ TEST_F(NullDecrypterTest, ShortInput) {
const char* data = reinterpret_cast<const char*>(expected);
size_t len = arraysize(expected);
NullDecrypter decrypter;
- scoped_ptr<QuicData> decrypted(
- decrypter.DecryptPacket(0, "hello world!", StringPiece(data, len)));
- ASSERT_FALSE(decrypted.get());
+ char buffer[256];
+ size_t length = 0;
+ ASSERT_FALSE(decrypter.DecryptPacket(
+ 0, "hello world!", StringPiece(data, len), buffer, &length, 256));
}
} // namespace test
« no previous file with comments | « net/quic/crypto/null_decrypter.cc ('k') | net/quic/crypto/null_encrypter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698