summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/lru_key_value_test.cpp
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2019-06-14 16:42:10 -0400
committerA. Jesse Jiryu Davis <jesse@mongodb.com>2019-06-14 19:23:18 -0400
commit47b380f03e8898f4706ff01fa2be64dfb72e0dba (patch)
treefb3508758c9abd0e297afee43ac847bf5aebcbbb /src/mongo/db/query/lru_key_value_test.cpp
parentb3c26131f6ab3f919beca658341e737de5d45683 (diff)
downloadmongo-47b380f03e8898f4706ff01fa2be64dfb72e0dba.tar.gz
SERVER-41071 Replace NULL and 0 with nullptr
Diffstat (limited to 'src/mongo/db/query/lru_key_value_test.cpp')
-rw-r--r--src/mongo/db/query/lru_key_value_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/query/lru_key_value_test.cpp b/src/mongo/db/query/lru_key_value_test.cpp
index 6b9ee7b90d6..9f15aad6c9a 100644
--- a/src/mongo/db/query/lru_key_value_test.cpp
+++ b/src/mongo/db/query/lru_key_value_test.cpp
@@ -41,7 +41,7 @@ namespace {
//
void assertInKVStore(LRUKeyValue<int, int>& cache, int key, int value) {
- int* cachedValue = NULL;
+ int* cachedValue = nullptr;
ASSERT_TRUE(cache.hasKey(key));
Status s = cache.get(key, &cachedValue);
ASSERT_OK(s);
@@ -49,7 +49,7 @@ void assertInKVStore(LRUKeyValue<int, int>& cache, int key, int value) {
}
void assertNotInKVStore(LRUKeyValue<int, int>& cache, int key) {
- int* cachedValue = NULL;
+ int* cachedValue = nullptr;
ASSERT_FALSE(cache.hasKey(key));
Status s = cache.get(key, &cachedValue);
ASSERT_NOT_OK(s);
@@ -99,7 +99,7 @@ TEST(LRUKeyValueTest, EvictionTest) {
LRUKeyValue<int, int> cache(maxSize);
for (int i = 0; i < maxSize; ++i) {
std::unique_ptr<int> evicted = cache.add(i, new int(i));
- ASSERT(NULL == evicted.get());
+ ASSERT(nullptr == evicted.get());
}
ASSERT_EQUALS(cache.size(), (size_t)maxSize);
@@ -115,7 +115,7 @@ TEST(LRUKeyValueTest, EvictionTest) {
// Adding another entry causes an eviction.
std::unique_ptr<int> evicted = cache.add(maxSize + 1, new int(maxSize + 1));
ASSERT_EQUALS(cache.size(), (size_t)maxSize);
- ASSERT(NULL != evicted.get());
+ ASSERT(nullptr != evicted.get());
ASSERT_EQUALS(*evicted, evictKey);
// Check that the least recently accessed has been evicted.
@@ -139,7 +139,7 @@ TEST(LRUKeyValueTest, PromotionTest) {
LRUKeyValue<int, int> cache(maxSize);
for (int i = 0; i < maxSize; ++i) {
std::unique_ptr<int> evicted = cache.add(i, new int(i));
- ASSERT(NULL == evicted.get());
+ ASSERT(nullptr == evicted.get());
}
ASSERT_EQUALS(cache.size(), (size_t)maxSize);
@@ -150,7 +150,7 @@ TEST(LRUKeyValueTest, PromotionTest) {
// Evict all but one of the original entries.
for (int i = maxSize; i < (maxSize + maxSize - 1); ++i) {
std::unique_ptr<int> evicted = cache.add(i, new int(i));
- ASSERT(NULL != evicted.get());
+ ASSERT(nullptr != evicted.get());
}
ASSERT_EQUALS(cache.size(), (size_t)maxSize);