From 72133adde48a7d48afc6becb505a26431cc28e74 Mon Sep 17 00:00:00 2001 From: Evgenii Stepanov Date: Tue, 26 May 2015 14:44:23 -0700 Subject: [PATCH] Fix alloc-dealloc-mismatch (new[] vs delete) in tests. Change-Id: I680eaf819f7d7d3a4149c833b6739cba4b7e21be --- runtime/arch/memcmp16_test.cc | 4 ++-- runtime/base/unix_file/random_access_file_test.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/arch/memcmp16_test.cc b/runtime/arch/memcmp16_test.cc index 5ba06f82a..9ba7de1df 100644 --- a/runtime/arch/memcmp16_test.cc +++ b/runtime/arch/memcmp16_test.cc @@ -144,10 +144,10 @@ static void CheckSeparate(size_t max_length, size_t min_length) { ASSERT_EQ(expected, computed) << "Run " << round << ", c1=" << count1 << " c2=" << count2; if (count1 > 0U) { - delete s1; + delete[] s1; } if (count2 > 0U) { - delete s2; + delete[] s2; } } } diff --git a/runtime/base/unix_file/random_access_file_test.h b/runtime/base/unix_file/random_access_file_test.h index e7ace4caa..91858c21d 100644 --- a/runtime/base/unix_file/random_access_file_test.h +++ b/runtime/base/unix_file/random_access_file_test.h @@ -82,7 +82,7 @@ class RandomAccessFileTest : public testing::Test { void TestReadContent(const std::string& content, RandomAccessFile* file) { const int buf_size = content.size() + 10; - std::unique_ptr buf(new char[buf_size]); + std::unique_ptr buf(new char[buf_size]); // Can't read from a negative offset. ASSERT_EQ(-EINVAL, file->Read(buf.get(), 0, -123)); -- 2.11.0