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

Unified Diff: sql/sqlite_features_unittest.cc

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: sql/sqlite_features_unittest.cc
diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc
index 481faf703d2865dd4348418a6aa8a642931e9282..2be1fd2a77f6ab967ad5e195292e55da346ea784 100644
--- a/sql/sqlite_features_unittest.cc
+++ b/sql/sqlite_features_unittest.cc
@@ -45,13 +45,8 @@ class SQLiteFeaturesTest : public testing::Test {
db_.Close();
}
- void VerifyAndClearLastError(int expected_error) {
- EXPECT_EQ(expected_error, error_);
- error_ = SQLITE_OK;
- sql_text_.clear();
- }
-
sql::Connection& db() { return db_; }
+ int error() { return error_; }
private:
base::ScopedTempDir temp_dir_;
@@ -147,8 +142,10 @@ TEST_F(SQLiteFeaturesTest, ForeignKeySupport) {
" pid INTEGER NOT NULL REFERENCES parents(id) ON DELETE CASCADE)"));
// Inserting without a matching parent should fail with constraint violation.
- EXPECT_FALSE(db().Execute("INSERT INTO children VALUES (10, 1)"));
- VerifyAndClearLastError(SQLITE_CONSTRAINT);
+ // Mask off any extended error codes for USE_SYSTEM_SQLITE.
+ int insertErr = db().ExecuteAndReturnErrorCode(
+ "INSERT INTO children VALUES (10, 1)");
+ EXPECT_EQ(SQLITE_CONSTRAINT, (insertErr&0xff));
size_t rows;
EXPECT_TRUE(sql::test::CountTableRows(&db(), "children", &rows));

Powered by Google App Engine
This is Rietveld 408576698