summaryrefslogtreecommitdiffstats
path: root/runtime/base/unix_file/random_access_file_test.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-05-19 16:49:03 -0700
committerIan Rogers <irogers@google.com>2014-05-19 22:27:39 -0700
commit700a402244a1a423da4f3ba8032459f4b65fa18f (patch)
tree4c22fcda04d271bd55a37aff30650214af17a90c /runtime/base/unix_file/random_access_file_test.h
parent047c11adcbcbc0bcf210defdfcbada763961ffee (diff)
downloadart-700a402244a1a423da4f3ba8032459f4b65fa18f.tar.gz
art-700a402244a1a423da4f3ba8032459f4b65fa18f.tar.bz2
art-700a402244a1a423da4f3ba8032459f4b65fa18f.zip
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/base/unix_file/random_access_file_test.h')
-rw-r--r--runtime/base/unix_file/random_access_file_test.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/base/unix_file/random_access_file_test.h b/runtime/base/unix_file/random_access_file_test.h
index 67e8c229f9..1d0b866960 100644
--- a/runtime/base/unix_file/random_access_file_test.h
+++ b/runtime/base/unix_file/random_access_file_test.h
@@ -18,11 +18,10 @@
#define ART_RUNTIME_BASE_UNIX_FILE_RANDOM_ACCESS_FILE_TEST_H_
#include <errno.h>
-
+#include <memory>
#include <string>
#include "common_runtime_test.h"
-#include "UniquePtrCompat.h"
namespace unix_file {
@@ -62,7 +61,7 @@ class RandomAccessFileTest : public testing::Test {
void TestRead() {
char buf[256];
- UniquePtr<RandomAccessFile> file(MakeTestFile());
+ std::unique_ptr<RandomAccessFile> file(MakeTestFile());
// Reading from the start of an empty file gets you zero bytes, however many
// you ask for.
@@ -77,7 +76,7 @@ class RandomAccessFileTest : public testing::Test {
void TestReadContent(const std::string& content, RandomAccessFile* file) {
const int buf_size = content.size() + 10;
- UniquePtr<char> buf(new char[buf_size]);
+ std::unique_ptr<char> buf(new char[buf_size]);
// Can't read from a negative offset.
ASSERT_EQ(-EINVAL, file->Read(buf.get(), 0, -123));
@@ -107,7 +106,7 @@ class RandomAccessFileTest : public testing::Test {
void TestSetLength() {
const std::string content("hello");
- UniquePtr<RandomAccessFile> file(MakeTestFile());
+ std::unique_ptr<RandomAccessFile> file(MakeTestFile());
ASSERT_EQ(content.size(), static_cast<uint64_t>(file->Write(content.data(), content.size(), 0)));
ASSERT_EQ(content.size(), static_cast<uint64_t>(file->GetLength()));
@@ -132,7 +131,7 @@ class RandomAccessFileTest : public testing::Test {
void TestWrite() {
const std::string content("hello");
- UniquePtr<RandomAccessFile> file(MakeTestFile());
+ std::unique_ptr<RandomAccessFile> file(MakeTestFile());
// Can't write to a negative offset.
ASSERT_EQ(-EINVAL, file->Write(content.data(), 0, -123));