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

Unified Diff: crypto/signature_creator_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/signature_creator_openssl.cc ('k') | crypto/signature_verifier_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/signature_creator_unittest.cc
diff --git a/crypto/signature_creator_unittest.cc b/crypto/signature_creator_unittest.cc
index fff065e58dd0f7e40a4b1a1ee22092f1721b9db9..819e663dacf83322f55239858963e9af5289e8ec 100644
--- a/crypto/signature_creator_unittest.cc
+++ b/crypto/signature_creator_unittest.cc
@@ -2,31 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "crypto/signature_creator.h"
+
#include <stdint.h>
+#include <memory>
#include <vector>
-#include "base/memory/scoped_ptr.h"
#include "base/sha1.h"
#include "crypto/rsa_private_key.h"
#include "crypto/sha2.h"
-#include "crypto/signature_creator.h"
#include "crypto/signature_verifier.h"
#include "testing/gtest/include/gtest/gtest.h"
TEST(SignatureCreatorTest, BasicTest) {
// Do a verify round trip.
- scoped_ptr<crypto::RSAPrivateKey> key_original(
+ std::unique_ptr<crypto::RSAPrivateKey> key_original(
crypto::RSAPrivateKey::Create(1024));
ASSERT_TRUE(key_original.get());
std::vector<uint8_t> key_info;
key_original->ExportPrivateKey(&key_info);
- scoped_ptr<crypto::RSAPrivateKey> key(
+ std::unique_ptr<crypto::RSAPrivateKey> key(
crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_info));
ASSERT_TRUE(key.get());
- scoped_ptr<crypto::SignatureCreator> signer(
+ std::unique_ptr<crypto::SignatureCreator> signer(
crypto::SignatureCreator::Create(key.get(),
crypto::SignatureCreator::SHA1));
ASSERT_TRUE(signer.get());
@@ -53,13 +54,13 @@ TEST(SignatureCreatorTest, BasicTest) {
TEST(SignatureCreatorTest, SignDigestTest) {
// Do a verify round trip.
- scoped_ptr<crypto::RSAPrivateKey> key_original(
+ std::unique_ptr<crypto::RSAPrivateKey> key_original(
crypto::RSAPrivateKey::Create(1024));
ASSERT_TRUE(key_original.get());
std::vector<uint8_t> key_info;
key_original->ExportPrivateKey(&key_info);
- scoped_ptr<crypto::RSAPrivateKey> key(
+ std::unique_ptr<crypto::RSAPrivateKey> key(
crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_info));
ASSERT_TRUE(key.get());
@@ -87,13 +88,13 @@ TEST(SignatureCreatorTest, SignDigestTest) {
TEST(SignatureCreatorTest, SignSHA256DigestTest) {
// Do a verify round trip.
- scoped_ptr<crypto::RSAPrivateKey> key_original(
+ std::unique_ptr<crypto::RSAPrivateKey> key_original(
crypto::RSAPrivateKey::Create(1024));
ASSERT_TRUE(key_original.get());
std::vector<uint8_t> key_info;
key_original->ExportPrivateKey(&key_info);
- scoped_ptr<crypto::RSAPrivateKey> key(
+ std::unique_ptr<crypto::RSAPrivateKey> key(
crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_info));
ASSERT_TRUE(key.get());
« no previous file with comments | « crypto/signature_creator_openssl.cc ('k') | crypto/signature_verifier_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698