From eff1fa525ce9cf8965cf187c9e7aef8c2db39bf9 Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Mon, 12 Dec 2011 23:50:59 +0000 Subject: Put debugging assertions into sql::Statement. Pulls out the core of gbillock's http://codereview.chromium.org/8283002/ - Move NOTREACHED and similar checks into the sql:: implementation code. - Add malformed SQL checks to Connection::Execute. - Add SQL-checking convenience methods to Connection. The general idea is that the sql:: framework assumes valid statements, rather than having client code contain scattered ad-hoc (and thus inconsistent) checks. This version puts back Statement operator overloading and loosy-goosy Execute() calls to allow other code to be updated in small batches. R=gbillock@chromium.org,jhawkins@chromium.org,dhollowa@chromium.org BUG=none TEST=sql_unittests,unit_tests:*Table*.* Review URL: http://codereview.chromium.org/8899012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114118 0039d316-1c4b-4281-b951-d872f2087c98 --- sql/sqlite_features_unittest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sqlite_features_unittest.cc') diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc index a25413d..e5cca49 100644 --- a/sql/sqlite_features_unittest.cc +++ b/sql/sqlite_features_unittest.cc @@ -81,7 +81,8 @@ class SQLiteFeaturesTest : public testing::Test { // Do not include fts1 support, it is not useful, and nobody is // looking at it. TEST_F(SQLiteFeaturesTest, NoFTS1) { - ASSERT_FALSE(db().Execute("CREATE VIRTUAL TABLE foo USING fts1(x)")); + ASSERT_EQ(SQLITE_ERROR, db().ExecuteAndReturnErrorCode( + "CREATE VIRTUAL TABLE foo USING fts1(x)")); } // fts2 is used for older history files, so we're signed on for -- cgit v1.1