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 TEST(AwesomePtrTest, Create) { | |
11 const char* c = "hi mom."; | |
12 awesome_ptr<const char> ptr(c); | |
13 } | |
14 | |
15 TEST(AwesomePtrTest, PointerFunctionality) { | |
Avi (use Gerrit)
2012/07/24 20:52:14
This tests the bool conversion, so I'd expect it t
awong
2012/07/24 20:56:53
Doh! cut/paste error.
| |
16 const char* c = "point to me."; | |
17 awesome_ptr<const char> ptr(c); | |
18 EXPECT_TRUE(c || ptr); // Yep. Boolean conversion compiles. | |
19 } | |
20 | |
21 TEST(AwesomePtrTest, BoolFunctionality) { | |
Avi (use Gerrit)
2012/07/24 20:52:14
...so this would need to be called something else.
awong
2012/07/24 20:56:53
fixed.
| |
22 const char* c = "its so so true."; | |
23 awesome_ptr<const char> ptr(c); | |
24 EXPECT_EQ(c, c); // Yep. Pointers are indeed reflexively equal. | |
25 } | |
26 | |
27 TEST(AwesomePtrTest, Awesome) { | |
28 const char* c = "can't stop this awesome."; | |
29 awesome_ptr<const char> ptr(c); | |
30 EXPECT_TRUE("this is awesome."); | |
31 } | |
32 } // namespace base | |
OLD | NEW |