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

Unified Diff: crypto/secure_hash_unittest.cc

Issue 1870233002: Convert crypto to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 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 | « crypto/scoped_test_system_nss_key_slot.h ('k') | crypto/sha2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/secure_hash_unittest.cc
diff --git a/crypto/secure_hash_unittest.cc b/crypto/secure_hash_unittest.cc
index 019e86f62ee060516eacb1b6841a085b041ac7d9..cb9f5852327e696fd6ed1d78b3067da64fa3b5e2 100644
--- a/crypto/secure_hash_unittest.cc
+++ b/crypto/secure_hash_unittest.cc
@@ -7,9 +7,9 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
-#include "base/memory/scoped_ptr.h"
#include "crypto/sha2.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,8 +23,8 @@ TEST(SecureHashTest, TestUpdate) {
uint8_t output3[crypto::kSHA256Length];
- scoped_ptr<crypto::SecureHash> ctx(crypto::SecureHash::Create(
- crypto::SecureHash::SHA256));
+ std::unique_ptr<crypto::SecureHash> ctx(
+ crypto::SecureHash::Create(crypto::SecureHash::SHA256));
ctx->Update(input3.data(), input3.size());
ctx->Update(input3.data(), input3.size());
@@ -50,12 +50,12 @@ TEST(SecureHashTest, TestClone) {
uint8_t output2[crypto::kSHA256Length];
uint8_t output3[crypto::kSHA256Length];
- scoped_ptr<crypto::SecureHash> ctx1(crypto::SecureHash::Create(
- crypto::SecureHash::SHA256));
+ std::unique_ptr<crypto::SecureHash> ctx1(
+ crypto::SecureHash::Create(crypto::SecureHash::SHA256));
ctx1->Update(input1.data(), input1.size());
- scoped_ptr<crypto::SecureHash> ctx2(ctx1->Clone());
- scoped_ptr<crypto::SecureHash> ctx3(ctx2->Clone());
+ std::unique_ptr<crypto::SecureHash> ctx2(ctx1->Clone());
+ std::unique_ptr<crypto::SecureHash> ctx3(ctx2->Clone());
// At this point, ctx1, ctx2, and ctx3 are all equivalent and represent the
// state after hashing input1.
@@ -76,7 +76,7 @@ TEST(SecureHashTest, TestClone) {
}
TEST(SecureHashTest, TestLength) {
- scoped_ptr<crypto::SecureHash> ctx(
+ std::unique_ptr<crypto::SecureHash> ctx(
crypto::SecureHash::Create(crypto::SecureHash::SHA256));
EXPECT_EQ(crypto::kSHA256Length, ctx->GetHashLength());
}
« no previous file with comments | « crypto/scoped_test_system_nss_key_slot.h ('k') | crypto/sha2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698