summaryrefslogtreecommitdiffstats
path: root/sql/test/test_helpers.h
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-06-19 18:38:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-20 01:38:55 +0000
commit102ceb4133685db70ac15cb5bcb134a85736fe86 (patch)
treeb902e100529fe3675e293c49c70eed32c430daf7 /sql/test/test_helpers.h
parent55002d65c4a31e6b386cbe9dc02dfaa24d3fb42d (diff)
downloadchromium_src-102ceb4133685db70ac15cb5bcb134a85736fe86.zip
chromium_src-102ceb4133685db70ac15cb5bcb134a85736fe86.tar.gz
chromium_src-102ceb4133685db70ac15cb5bcb134a85736fe86.tar.bz2
mandoline filesystem: add a sqlite3 vfs to proxy filesystem usage.
This adds a //sql/mojo library which can be linked into preexisting sqlite3 code which adds a new VFS which transparently proxies filesystem usage to the mojo:filesystem application. We create a new sql_apptests.mojo target, which currently has all the sql connection_unittests.cc (minus 2 hard ones), all statement and transaction unit tests and refactor the sql testing stuff so that we have two implementations of an SQLTestBase class: one that uses files raw and one that proxies to the filesystem process. Notably, this patch does not implement file locking, which will have to be implemented before we can safely use this, but will be a large enough patch in and of itself that I'm punting on it for this patch. BUG=493311 Review URL: https://codereview.chromium.org/1176653002 Cr-Commit-Position: refs/heads/master@{#335415}
Diffstat (limited to 'sql/test/test_helpers.h')
-rw-r--r--sql/test/test_helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/test/test_helpers.h b/sql/test/test_helpers.h
index e93b207..b2cecb0 100644
--- a/sql/test/test_helpers.h
+++ b/sql/test/test_helpers.h
@@ -33,6 +33,11 @@ namespace test {
// Returns false if any error occurs accessing the file.
bool CorruptSizeInHeader(const base::FilePath& db_path) WARN_UNUSED_RESULT;
+// Common implementation of CorruptSizeInHeader() which operates on loaded
+// memory. Shared between CorruptSizeInHeader() and the the mojo proxy testing
+// code.
+void CorruptSizeInHeaderMemory(unsigned char* header, int64_t db_size);
+
// Frequently corruption is a result of failure to atomically update
// pages in different structures. For instance, if an index update
// takes effect but the corresponding table update does not. This