From 700a402244a1a423da4f3ba8032459f4b65fa18f Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 19 May 2014 16:49:03 -0700 Subject: 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 --- runtime/dex_file_test.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime/dex_file_test.cc') 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 + #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 dst(new byte[tmp.size()]); + std::unique_ptr 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 dex_bytes(DecodeBase64(base64, &length)); + std::unique_ptr dex_bytes(DecodeBase64(base64, &length)); CHECK(dex_bytes.get() != NULL); // write to provided file - UniquePtr file(OS::CreateEmptyFile(location)); + std::unique_ptr 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 raw(OpenDexFileBase64(kRawDex, tmp.GetFilename().c_str())); + std::unique_ptr raw(OpenDexFileBase64(kRawDex, tmp.GetFilename().c_str())); ASSERT_TRUE(raw.get() != NULL); const DexFile::Header& header = raw->GetHeader(); -- cgit v1.2.3-59-g8ed1b