summaryrefslogtreecommitdiffstats
path: root/sql/connection_unittest.cc
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-06 02:37:40 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-06 02:37:40 +0000
commitdd325f05aefa973c09d492efa9233aaa1b3f3a41 (patch)
treef5c9ad9abe1ad69c14ffc59394056cc333c40bc2 /sql/connection_unittest.cc
parente846329d778902ee1eb9e0e5884320fd0dc42e87 (diff)
downloadchromium_src-dd325f05aefa973c09d492efa9233aaa1b3f3a41.zip
chromium_src-dd325f05aefa973c09d492efa9233aaa1b3f3a41.tar.gz
chromium_src-dd325f05aefa973c09d492efa9233aaa1b3f3a41.tar.bz2
[sql] Use recover virtual table in sql::Recovery.
Load the recover virtual table as part of sql::Recovery::Begin(), and implement basic unit tests that it correctly recovers valid and corrupt tables. BUG=109482 Review URL: https://chromiumcodereview.appspot.com/20022006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection_unittest.cc')
-rw-r--r--sql/connection_unittest.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc
index 58dedbc..09a47fb 100644
--- a/sql/connection_unittest.cc
+++ b/sql/connection_unittest.cc
@@ -425,7 +425,7 @@ TEST_F(SQLConnectionTest, RazeEmptyDB) {
db().Close();
{
- file_util::ScopedFILE file(file_util::OpenFile(db_path(), "r+"));
+ file_util::ScopedFILE file(file_util::OpenFile(db_path(), "rb+"));
ASSERT_TRUE(file.get() != NULL);
ASSERT_EQ(0, fseek(file.get(), 0, SEEK_SET));
ASSERT_TRUE(file_util::TruncateFile(file.get()));
@@ -443,7 +443,7 @@ TEST_F(SQLConnectionTest, RazeNOTADB) {
ASSERT_FALSE(base::PathExists(db_path()));
{
- file_util::ScopedFILE file(file_util::OpenFile(db_path(), "w"));
+ file_util::ScopedFILE file(file_util::OpenFile(db_path(), "wb"));
ASSERT_TRUE(file.get() != NULL);
const char* kJunk = "This is the hour of our discontent.";
@@ -476,7 +476,7 @@ TEST_F(SQLConnectionTest, RazeNOTADB2) {
db().Close();
{
- file_util::ScopedFILE file(file_util::OpenFile(db_path(), "r+"));
+ file_util::ScopedFILE file(file_util::OpenFile(db_path(), "rb+"));
ASSERT_TRUE(file.get() != NULL);
ASSERT_EQ(0, fseek(file.get(), 0, SEEK_SET));
@@ -526,7 +526,7 @@ TEST_F(SQLConnectionTest, RazeCallbackReopen) {
// Trim a single page from the end of the file.
{
- file_util::ScopedFILE file(file_util::OpenFile(db_path(), "r+"));
+ file_util::ScopedFILE file(file_util::OpenFile(db_path(), "rb+"));
ASSERT_TRUE(file.get() != NULL);
ASSERT_EQ(0, fseek(file.get(), -page_size, SEEK_END));
ASSERT_TRUE(file_util::TruncateFile(file.get()));