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

Side by Side Diff: sql/meta_table_unittest.cc

Issue 817403002: Standardize usage of virtual/override/final specifiers in sql/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 | « sql/connection_unittest.cc ('k') | sql/recovery_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "sql/meta_table.h" 5 #include "sql/meta_table.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "sql/connection.h" 9 #include "sql/connection.h"
10 #include "sql/statement.h" 10 #include "sql/statement.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace { 13 namespace {
14 14
15 class SQLMetaTableTest : public testing::Test { 15 class SQLMetaTableTest : public testing::Test {
16 public: 16 public:
17 virtual void SetUp() { 17 void SetUp() override {
18 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 18 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
19 ASSERT_TRUE(db_.Open(temp_dir_.path().AppendASCII("SQLMetaTableTest.db"))); 19 ASSERT_TRUE(db_.Open(temp_dir_.path().AppendASCII("SQLMetaTableTest.db")));
20 } 20 }
21 21
22 virtual void TearDown() { 22 void TearDown() override { db_.Close(); }
23 db_.Close();
24 }
25 23
26 sql::Connection& db() { return db_; } 24 sql::Connection& db() { return db_; }
27 25
28 private: 26 private:
29 base::ScopedTempDir temp_dir_; 27 base::ScopedTempDir temp_dir_;
30 sql::Connection db_; 28 sql::Connection db_;
31 }; 29 };
32 30
33 TEST_F(SQLMetaTableTest, DoesTableExist) { 31 TEST_F(SQLMetaTableTest, DoesTableExist) {
34 EXPECT_FALSE(sql::MetaTable::DoesTableExist(&db())); 32 EXPECT_FALSE(sql::MetaTable::DoesTableExist(&db()));
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 EXPECT_TRUE(meta_table.SetValue(kKey, kValue)); 262 EXPECT_TRUE(meta_table.SetValue(kKey, kValue));
265 EXPECT_TRUE(meta_table.GetValue(kKey, &value)); 263 EXPECT_TRUE(meta_table.GetValue(kKey, &value));
266 EXPECT_EQ(kValue, value); 264 EXPECT_EQ(kValue, value);
267 265
268 // After delete value isn't present. 266 // After delete value isn't present.
269 EXPECT_TRUE(meta_table.DeleteKey(kKey)); 267 EXPECT_TRUE(meta_table.DeleteKey(kKey));
270 EXPECT_FALSE(meta_table.GetValue(kKey, &value)); 268 EXPECT_FALSE(meta_table.GetValue(kKey, &value));
271 } 269 }
272 270
273 } // namespace 271 } // namespace
OLDNEW
« no previous file with comments | « sql/connection_unittest.cc ('k') | sql/recovery_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698