Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: base/memory/scoped_ptr_unittest.cc

Issue 11149006: Extend scoped_ptr to be closer to unique_ptr. Support custom deleters, and deleting arrays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unittest Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/memory/scoped_ptr_unittest.cc
diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc
index 3da6f15273181070fa51cc25107708def2fffa1f..255a23cfd9f574afb7c0315c6c135080d463f578 100644
--- a/base/memory/scoped_ptr_unittest.cc
+++ b/base/memory/scoped_ptr_unittest.cc
@@ -4,8 +4,12 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/callback.h"
+#include "base/bind.h"
#include "testing/gtest/include/gtest/gtest.h"
+// TODO(ajwong): Add unittest for a class that defines a delete operator.
+
namespace {
// Used to test depth subtyping.
@@ -121,6 +125,15 @@ TEST(ScopedPtrTest, ScopedPtr) {
EXPECT_EQ(0, constructed);
}
+TEST(ScopedPtrTest, ScopedPtrArray) {
+ int constructed = 0;
+
+ {
+ scoped_ptr<int[]> scoper(new int[10]);
+ }
+ EXPECT_EQ(0, constructed);
+}
+
TEST(ScopedPtrTest, ScopedPtrDepthSubtyping) {
int constructed = 0;

Powered by Google App Engine
This is Rietveld 408576698