diff options
author | Andreas Gampe <agampe@google.com> | 2017-10-02 21:36:51 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-02 21:36:51 +0000 |
commit | ee9678af99f1071caacd330d444248c0a9149495 (patch) | |
tree | d5a3bffb61273ce114d7115b5a4398f12b4ce0c7 | |
parent | 43b810774c73e8c6fd72f70c005d10ce946dbe3b (diff) | |
parent | 266f541100e88a295277d594bc026a9a866349dc (diff) | |
download | libhardware-ee9678af99f1071caacd330d444248c0a9149495.tar.gz |
Merge "Keymaster: Move test to std::unique_ptr" am: ce1ed06244 am: 70f96855a7
am: 266f541100
Change-Id: I0ce17d4f3775c72eaf733b8245a3cb7a83749726
-rw-r--r-- | tests/keymaster/keymaster_test.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/keymaster/keymaster_test.cpp b/tests/keymaster/keymaster_test.cpp index e8fa9909..b6903f38 100644 --- a/tests/keymaster/keymaster_test.cpp +++ b/tests/keymaster/keymaster_test.cpp @@ -23,6 +23,7 @@ #include <fstream> #include <iostream> +#include <memory> #include <gtest/gtest.h> @@ -33,20 +34,18 @@ #define LOG_TAG "keymaster_test" #include <utils/Log.h> -#include <nativehelper/UniquePtr.h> - #include <hardware/keymaster0.h> namespace android { -class UniqueBlob : public UniquePtr<uint8_t[]> { +class UniqueBlob : public std::unique_ptr<uint8_t[]> { public: explicit UniqueBlob(size_t length) : mLength(length) { } UniqueBlob(uint8_t* bytes, size_t length) : - UniquePtr<uint8_t[]>(bytes), mLength(length) { + std::unique_ptr<uint8_t[]>(bytes), mLength(length) { } bool operator==(const UniqueBlob &other) const { @@ -164,35 +163,35 @@ struct BIGNUM_Delete { BN_free(p); } }; -typedef UniquePtr<BIGNUM, BIGNUM_Delete> Unique_BIGNUM; +typedef std::unique_ptr<BIGNUM, BIGNUM_Delete> Unique_BIGNUM; struct EVP_PKEY_Delete { void operator()(EVP_PKEY* p) const { EVP_PKEY_free(p); } }; -typedef UniquePtr<EVP_PKEY, EVP_PKEY_Delete> Unique_EVP_PKEY; +typedef std::unique_ptr<EVP_PKEY, EVP_PKEY_Delete> Unique_EVP_PKEY; struct PKCS8_PRIV_KEY_INFO_Delete { void operator()(PKCS8_PRIV_KEY_INFO* p) const { PKCS8_PRIV_KEY_INFO_free(p); } }; -typedef UniquePtr<PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_Delete> Unique_PKCS8_PRIV_KEY_INFO; +typedef std::unique_ptr<PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_Delete> Unique_PKCS8_PRIV_KEY_INFO; struct RSA_Delete { void operator()(RSA* p) const { RSA_free(p); } }; -typedef UniquePtr<RSA, RSA_Delete> Unique_RSA; +typedef std::unique_ptr<RSA, RSA_Delete> Unique_RSA; struct EC_KEY_Delete { void operator()(EC_KEY* p) const { EC_KEY_free(p); } }; -typedef UniquePtr<EC_KEY, EC_KEY_Delete> Unique_EC_KEY; +typedef std::unique_ptr<EC_KEY, EC_KEY_Delete> Unique_EC_KEY; /* |