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

Side by Side Diff: app/sql/connection_unittest.cc

Issue 3108030: Move bundled copy of sqlite one level deeper to better separate it... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « app/sql/connection.cc ('k') | app/sql/statement.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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/sql/connection.h" 5 #include "app/sql/connection.h"
6 #include "app/sql/statement.h" 6 #include "app/sql/statement.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/sqlite/preprocessed/sqlite3.h" 11 #include "third_party/sqlite/sqlite3.h"
12 12
13 class SQLConnectionTest : public testing::Test { 13 class SQLConnectionTest : public testing::Test {
14 public: 14 public:
15 SQLConnectionTest() {} 15 SQLConnectionTest() {}
16 16
17 void SetUp() { 17 void SetUp() {
18 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path_)); 18 ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path_));
19 path_ = path_.AppendASCII("SQLConnectionTest.db"); 19 path_ = path_.AppendASCII("SQLConnectionTest.db");
20 file_util::Delete(path_, false); 20 file_util::Delete(path_, false);
21 ASSERT_TRUE(db_.Open(path_)); 21 ASSERT_TRUE(db_.Open(path_));
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 int64 row = db().GetLastInsertRowId(); 104 int64 row = db().GetLastInsertRowId();
105 EXPECT_LT(0, row); 105 EXPECT_LT(0, row);
106 106
107 // It should be the primary key of the row we just inserted. 107 // It should be the primary key of the row we just inserted.
108 sql::Statement s(db().GetUniqueStatement("SELECT value FROM foo WHERE id=?")); 108 sql::Statement s(db().GetUniqueStatement("SELECT value FROM foo WHERE id=?"));
109 s.BindInt64(0, row); 109 s.BindInt64(0, row);
110 ASSERT_TRUE(s.Step()); 110 ASSERT_TRUE(s.Step());
111 EXPECT_EQ(12, s.ColumnInt(0)); 111 EXPECT_EQ(12, s.ColumnInt(0));
112 } 112 }
113 113
OLDNEW
« no previous file with comments | « app/sql/connection.cc ('k') | app/sql/statement.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698