diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 18:55:22 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 18:55:22 +0000 |
commit | e73e8922ac9d6575dcd141b2908885dce52bfd0b (patch) | |
tree | 018adc0a43a23e78817ac74619b28c7d71dd3afd /sql | |
parent | e8fb36c3192133fd1ce7cc31409e604c1c3feb71 (diff) | |
download | chromium_src-e73e8922ac9d6575dcd141b2908885dce52bfd0b.zip chromium_src-e73e8922ac9d6575dcd141b2908885dce52bfd0b.tar.gz chromium_src-e73e8922ac9d6575dcd141b2908885dce52bfd0b.tar.bz2 |
Modify sql unittests to pass on iOS.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10702203
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql')
-rw-r--r-- | sql/connection_unittest.cc | 9 | ||||
-rw-r--r-- | sql/run_all_unittests.cc | 4 | ||||
-rw-r--r-- | sql/sqlite_features_unittest.cc | 7 |
3 files changed, 13 insertions, 7 deletions
diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc index 97dd152..773de5b 100644 --- a/sql/connection_unittest.cc +++ b/sql/connection_unittest.cc @@ -173,15 +173,16 @@ TEST_F(SQLConnectionTest, Raze) { // Test that Raze() maintains page_size. TEST_F(SQLConnectionTest, RazePageSize) { - const int kPageSize = 4096; - - // Make sure that the default size isn't already |kPageSize|. + // Fetch the default page size and double it for use in this test. // Scoped to release statement before Close(). + int default_page_size = 0; { sql::Statement s(db().GetUniqueStatement("PRAGMA page_size")); ASSERT_TRUE(s.Step()); - ASSERT_NE(kPageSize, s.ColumnInt(0)); + default_page_size = s.ColumnInt(0); } + ASSERT_GT(default_page_size, 0); + const int kPageSize = 2 * default_page_size; // Re-open the database to allow setting the page size. db().Close(); diff --git a/sql/run_all_unittests.cc b/sql/run_all_unittests.cc index 7fd6ef2..969b091 100644 --- a/sql/run_all_unittests.cc +++ b/sql/run_all_unittests.cc @@ -1,9 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/test/main_hook.h" #include "base/test/test_suite.h" int main(int argc, char** argv) { + MainHook hook(main, argc, argv); return base::TestSuite(argc, argv).Run(); } diff --git a/sql/sqlite_features_unittest.cc b/sql/sqlite_features_unittest.cc index 08e1819..d3ad7b0 100644 --- a/sql/sqlite_features_unittest.cc +++ b/sql/sqlite_features_unittest.cc @@ -83,13 +83,16 @@ TEST_F(SQLiteFeaturesTest, NoFTS1) { "CREATE VIRTUAL TABLE foo USING fts1(x)")); } -// fts2 is used for older history files, so we're signed on for -// keeping our version up-to-date. +#if !defined(OS_IOS) +// fts2 is used for older history files, so we're signed on for keeping our +// version up-to-date. iOS does not include fts2, so this test does not run on +// iOS. // TODO(shess): Think up a crazy way to get out from having to support // this forever. TEST_F(SQLiteFeaturesTest, FTS2) { ASSERT_TRUE(db().Execute("CREATE VIRTUAL TABLE foo USING fts2(x)")); } +#endif // fts3 is used for current history files, and also for WebDatabase. TEST_F(SQLiteFeaturesTest, FTS3) { |