diff options
author | 2014-05-19 16:49:03 -0700 | |
---|---|---|
committer | 2014-05-19 22:27:39 -0700 | |
commit | 700a402244a1a423da4f3ba8032459f4b65fa18f (patch) | |
tree | 4c22fcda04d271bd55a37aff30650214af17a90c /runtime/dex_file_test.cc | |
parent | 047c11adcbcbc0bcf210defdfcbada763961ffee (diff) |
Now we have a proper C++ library, use std::unique_ptr.
Also remove the Android.libcxx.mk and other bits of stlport compatibility
mechanics.
Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
Diffstat (limited to 'runtime/dex_file_test.cc')
-rw-r--r-- | runtime/dex_file_test.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/dex_file_test.cc b/runtime/dex_file_test.cc index 86c282e894..a814c343cd 100644 --- a/runtime/dex_file_test.cc +++ b/runtime/dex_file_test.cc @@ -16,7 +16,8 @@ #include "dex_file.h" -#include "UniquePtrCompat.h" +#include <memory> + #include "common_runtime_test.h" namespace art { @@ -90,7 +91,7 @@ static inline byte* DecodeBase64(const char* src, size_t* dst_size) { *dst_size = 0; return nullptr; } - UniquePtr<byte[]> dst(new byte[tmp.size()]); + std::unique_ptr<byte[]> dst(new byte[tmp.size()]); if (dst_size != nullptr) { *dst_size = tmp.size(); } else { @@ -131,11 +132,11 @@ static const DexFile* OpenDexFileBase64(const char* base64, // decode base64 CHECK(base64 != NULL); size_t length; - UniquePtr<byte[]> dex_bytes(DecodeBase64(base64, &length)); + std::unique_ptr<byte[]> dex_bytes(DecodeBase64(base64, &length)); CHECK(dex_bytes.get() != NULL); // write to provided file - UniquePtr<File> file(OS::CreateEmptyFile(location)); + std::unique_ptr<File> file(OS::CreateEmptyFile(location)); CHECK(file.get() != NULL); if (!file->WriteFully(dex_bytes.get(), length)) { PLOG(FATAL) << "Failed to write base64 as dex file"; @@ -154,7 +155,7 @@ static const DexFile* OpenDexFileBase64(const char* base64, TEST_F(DexFileTest, Header) { ScratchFile tmp; - UniquePtr<const DexFile> raw(OpenDexFileBase64(kRawDex, tmp.GetFilename().c_str())); + std::unique_ptr<const DexFile> raw(OpenDexFileBase64(kRawDex, tmp.GetFilename().c_str())); ASSERT_TRUE(raw.get() != NULL); const DexFile::Header& header = raw->GetHeader(); |