| // Copyright 2020 The PDFium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "core/fxcrt/autonuller.h" |
| #include "core/fxcrt/unowned_ptr.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| TEST(fxcrt, AutoNuller) { |
| AutoNuller<int*> nuller(&ptr); |
| TEST(fxcrt, AutoNullerAbandon) { |
| AutoNuller<int*> nuller(&ptr); |
| nuller.AbandonNullification(); |
| TEST(fxcrt, AutoNullerUnownedPtr) { |
| AutoNuller<UnownedPtr<int>> nuller(&ptr); |
| TEST(fxcrt, AutoNullerUnownedPtrAbandon) { |
| AutoNuller<UnownedPtr<int>> nuller(&ptr); |
| nuller.AbandonNullification(); |