Chromium Code Reviews| Index: sql/connection_unittest.cc |
| diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc |
| index 565c12fb9ab113c781de7ebe4e29bd3edb530f8a..d12b643db3081cbea4f669df5b6f2eb4fd135651 100644 |
| --- a/sql/connection_unittest.cc |
| +++ b/sql/connection_unittest.cc |
| @@ -142,11 +142,13 @@ TEST_F(SQLConnectionTest, Raze) { |
| ASSERT_TRUE(db().Execute(kCreateSql)); |
| ASSERT_TRUE(db().Execute("INSERT INTO foo (value) VALUES (12)")); |
| + int page_count_before_raze = 0; |
| { |
| sql::Statement s(db().GetUniqueStatement("PRAGMA page_count")); |
| ASSERT_TRUE(s.Step()); |
| - EXPECT_EQ(2, s.ColumnInt(0)); |
| + page_count_before_raze = s.ColumnInt(0); |
| } |
| + ASSERT_GT(page_count_before_raze, 0); |
| { |
| sql::Statement s(db().GetUniqueStatement("SELECT * FROM sqlite_master")); |
| @@ -154,7 +156,7 @@ TEST_F(SQLConnectionTest, Raze) { |
| EXPECT_EQ("table", s.ColumnString(0)); |
| EXPECT_EQ("foo", s.ColumnString(1)); |
| EXPECT_EQ("foo", s.ColumnString(2)); |
| - EXPECT_EQ(2, s.ColumnInt(3)); |
| + EXPECT_EQ(page_count_before_raze, s.ColumnInt(3)); |
|
Scott Hess - ex-Googler
2012/07/27 22:23:29
Hmm. Maybe toss in a comment to the end of "Table
|
| EXPECT_EQ(kCreateSql, s.ColumnString(4)); |
| } |
| @@ -163,7 +165,7 @@ TEST_F(SQLConnectionTest, Raze) { |
| { |
| sql::Statement s(db().GetUniqueStatement("PRAGMA page_count")); |
| ASSERT_TRUE(s.Step()); |
| - EXPECT_EQ(1, s.ColumnInt(0)); |
| + EXPECT_LT(s.ColumnInt(0), page_count_before_raze); |
|
Scott Hess - ex-Googler
2012/07/27 22:23:29
And then here, add a comment that the last page of
|
| } |
| { |