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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc

Issue 610223002: [SyncFS] Use nullptr instead of NULL (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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h" 5 #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 ASSERT_TRUE(itr->Valid()); 63 ASSERT_TRUE(itr->Valid());
64 EXPECT_EQ(expects[i].key, itr->key().ToString()); 64 EXPECT_EQ(expects[i].key, itr->key().ToString());
65 EXPECT_EQ(expects[i].value, itr->value().ToString()); 65 EXPECT_EQ(expects[i].value, itr->value().ToString());
66 itr->Next(); 66 itr->Next();
67 } 67 }
68 EXPECT_FALSE(itr->Valid()); 68 EXPECT_FALSE(itr->Valid());
69 } 69 }
70 70
71 private: 71 private:
72 void InitializeLevelDB() { 72 void InitializeLevelDB() {
73 leveldb::DB* db = NULL; 73 leveldb::DB* db = nullptr;
74 leveldb::Options options; 74 leveldb::Options options;
75 options.create_if_missing = true; 75 options.create_if_missing = true;
76 options.max_open_files = 0; // Use minimum. 76 options.max_open_files = 0; // Use minimum.
77 options.env = in_memory_env_.get(); 77 options.env = in_memory_env_.get();
78 leveldb::Status status = 78 leveldb::Status status =
79 leveldb::DB::Open(options, database_dir_.path().AsUTF8Unsafe(), &db); 79 leveldb::DB::Open(options, database_dir_.path().AsUTF8Unsafe(), &db);
80 ASSERT_TRUE(status.ok()); 80 ASSERT_TRUE(status.ok());
81 81
82 db_.reset(new LevelDBWrapper(make_scoped_ptr(db))); 82 db_.reset(new LevelDBWrapper(make_scoped_ptr(db)));
83 } 83 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 EXPECT_EQ(0, GetDB()->num_puts()); 233 EXPECT_EQ(0, GetDB()->num_puts());
234 EXPECT_EQ(0, GetDB()->num_deletes()); 234 EXPECT_EQ(0, GetDB()->num_deletes());
235 235
236 SCOPED_TRACE("DeleteTest_Commit"); 236 SCOPED_TRACE("DeleteTest_Commit");
237 CheckDBContents(merged_data, arraysize(merged_data)); 237 CheckDBContents(merged_data, arraysize(merged_data));
238 } 238 }
239 239
240 } // namespace drive_backend 240 } // namespace drive_backend
241 } // namespace sync_file_system 241 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698