Index: base/memory/awesome_ptr_unittest.cc |
diff --git a/base/memory/awesome_ptr_unittest.cc b/base/memory/awesome_ptr_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e33c12a85291ffcf65ae7e7ed95f4e8e6e55018c |
--- /dev/null |
+++ b/base/memory/awesome_ptr_unittest.cc |
@@ -0,0 +1,37 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "base/memory/awesome_ptr.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace base { |
+ |
+namespace totally { |
+ |
+TEST(AwesomePtrTest, Create) { |
+ const char* c = "hi mom."; |
+ awesome_ptr<const char> ptr(c); |
+} |
+ |
+TEST(AwesomePtrTest, BoolFunctionality) { |
+ const char* c = "its so so true."; |
+ awesome_ptr<const char> ptr(c); |
+ EXPECT_TRUE(c || ptr); // Yep. Boolean conversion compiles. |
+} |
+ |
+TEST(AwesomePtrTest, PointerFunctionality) { |
+ const char* c = "point to me."; |
+ awesome_ptr<const char> ptr(c); |
+ EXPECT_EQ(c, c); // Yep. Pointers are indeed reflexively equal. |
+} |
+ |
+TEST(AwesomePtrTest, Awesome) { |
+ const char* c = "can't stop this awesome."; |
+ awesome_ptr<const char> ptr(c); |
+ EXPECT_TRUE("this is awesome."); |
+} |
+ |
+} // namespace totally |
+ |
+} // namespace base |