OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/fxcrt/include/cfx_observable.h" | 5 #include "core/fxcrt/cfx_observable.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "testing/fx_string_testhelpers.h" | 9 #include "testing/fx_string_testhelpers.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 class PseudoObservable : public CFX_Observable<PseudoObservable> { | 14 class PseudoObservable : public CFX_Observable<PseudoObservable> { |
15 public: | 15 public: |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 TEST(fxcrt, ObservePtrBool) { | 106 TEST(fxcrt, ObservePtrBool) { |
107 PseudoObservable obj1; | 107 PseudoObservable obj1; |
108 PseudoObservable::ObservedPtr null_ptr; | 108 PseudoObservable::ObservedPtr null_ptr; |
109 PseudoObservable::ObservedPtr obj1_ptr(&obj1); | 109 PseudoObservable::ObservedPtr obj1_ptr(&obj1); |
110 bool null_bool = !!null_ptr; | 110 bool null_bool = !!null_ptr; |
111 bool obj1_bool = !!obj1_ptr; | 111 bool obj1_bool = !!obj1_ptr; |
112 EXPECT_FALSE(null_bool); | 112 EXPECT_FALSE(null_bool); |
113 EXPECT_TRUE(obj1_bool); | 113 EXPECT_TRUE(obj1_bool); |
114 } | 114 } |
OLD | NEW |