Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Side by Side Diff: base/memory/discardable_memory_unittest.cc

Issue 659143002: base: Use nullptr instead of NULL and static_cast in discardable memory unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium 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 "base/memory/discardable_memory.h" 5 #include "base/memory/discardable_memory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 supported_types.end(), 58 supported_types.end(),
59 IsNativeType)); 59 IsNativeType));
60 #endif 60 #endif
61 } 61 }
62 62
63 // Test Lock() and Unlock() functionalities. 63 // Test Lock() and Unlock() functionalities.
64 TEST_P(DiscardableMemoryTest, LockAndUnLock) { 64 TEST_P(DiscardableMemoryTest, LockAndUnLock) {
65 const scoped_ptr<DiscardableMemory> memory(CreateLockedMemory(kSize)); 65 const scoped_ptr<DiscardableMemory> memory(CreateLockedMemory(kSize));
66 ASSERT_TRUE(memory); 66 ASSERT_TRUE(memory);
67 void* addr = memory->Memory(); 67 void* addr = memory->Memory();
68 ASSERT_NE(static_cast<void*>(NULL), addr); 68 ASSERT_NE(nullptr, addr);
69 69
70 memory->Unlock(); 70 memory->Unlock();
71 71
72 EXPECT_NE(DISCARDABLE_MEMORY_LOCK_STATUS_FAILED, memory->Lock()); 72 EXPECT_NE(DISCARDABLE_MEMORY_LOCK_STATUS_FAILED, memory->Lock());
73 addr = memory->Memory(); 73 addr = memory->Memory();
74 ASSERT_NE(static_cast<void*>(NULL), addr); 74 ASSERT_NE(nullptr, addr);
75 75
76 memory->Unlock(); 76 memory->Unlock();
77 } 77 }
78 78
79 // Test delete a discardable memory while it is locked. 79 // Test delete a discardable memory while it is locked.
80 TEST_P(DiscardableMemoryTest, DeleteWhileLocked) { 80 TEST_P(DiscardableMemoryTest, DeleteWhileLocked) {
81 const scoped_ptr<DiscardableMemory> memory(CreateLockedMemory(kSize)); 81 const scoped_ptr<DiscardableMemory> memory(CreateLockedMemory(kSize));
82 ASSERT_TRUE(memory); 82 ASSERT_TRUE(memory);
83 } 83 }
84 84
(...skipping 24 matching lines...) Expand all
109 return supported_types; 109 return supported_types;
110 } 110 }
111 111
112 INSTANTIATE_TEST_CASE_P( 112 INSTANTIATE_TEST_CASE_P(
113 DiscardableMemoryTests, 113 DiscardableMemoryTests,
114 DiscardableMemoryTest, 114 DiscardableMemoryTest,
115 ::testing::ValuesIn(GetSupportedDiscardableMemoryTypes())); 115 ::testing::ValuesIn(GetSupportedDiscardableMemoryTypes()));
116 116
117 } // namespace 117 } // namespace
118 } // namespace base 118 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698