OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/memory/awesome_ptr.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 |
| 8 namespace base { |
| 9 |
| 10 namespace totally { |
| 11 |
| 12 TEST(AwesomePtrTest, Create) { |
| 13 const char* c = "hi mom."; |
| 14 awesome_ptr<const char> ptr(c); |
| 15 } |
| 16 |
| 17 TEST(AwesomePtrTest, BoolFunctionality) { |
| 18 const char* c = "its so so true."; |
| 19 awesome_ptr<const char> ptr(c); |
| 20 EXPECT_TRUE(c || ptr); // Yep. Boolean conversion compiles. |
| 21 } |
| 22 |
| 23 TEST(AwesomePtrTest, PointerFunctionality) { |
| 24 const char* c = "point to me."; |
| 25 awesome_ptr<const char> ptr(c); |
| 26 EXPECT_EQ(c, c); // Yep. Pointers are indeed reflexively equal. |
| 27 } |
| 28 |
| 29 TEST(AwesomePtrTest, Awesome) { |
| 30 const char* c = "can't stop this awesome."; |
| 31 awesome_ptr<const char> ptr(c); |
| 32 EXPECT_TRUE("this is awesome."); |
| 33 } |
| 34 |
| 35 } // namespace totally |
| 36 |
| 37 } // namespace base |
OLD | NEW |