Skip to content

Commit

Permalink
sqlite: Rewrite tests for custom recovery code.
Browse files Browse the repository at this point in the history
Our largest SQLite patch,
0001-Virtual-table-supporting-recovery-of-corrupted-datab.patch,
contains the implementation of a virtual table extension that contains
custom recovery logic. The automated tests for the extension use
SQLite's infrastructure base on Tcl, and don't run on CQ.

This CL rewrites the tests to use C++ and //sql, so they can be run on
CQ. A follow-up CL will replace the recovery code with a rewritten
version that lives in the Chromium tree.

This CL also adds a test covering the edge cases of the recovery code's
SQLite varint decoding logic, which has proven useful for debugging the
rewritten recovery code.

Bug: 945204
Change-Id: I50c6cbf6f94dc698915e6fb4925769051396cb4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1603604
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659225}
  • Loading branch information
pwnall authored and Commit Bot committed May 13, 2019
1 parent ffc7906 commit 455989b
Show file tree
Hide file tree
Showing 9 changed files with 1,238 additions and 2 deletions.
1 change: 1 addition & 0 deletions sql/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ test("sql_unittests") {
sources = [
"database_unittest.cc",
"meta_table_unittest.cc",
"recover_module_unittest.cc",
"recovery_unittest.cc",
"sql_memory_dump_provider_unittest.cc",
"sqlite_features_unittest.cc",
Expand Down
5 changes: 5 additions & 0 deletions sql/internal_api_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace sql {

namespace test {
struct ColumnInfo;
} // namespace test

// Restricts access to APIs internal to the //sql package.
//
// This implements Java's package-private via the passkey idiom.
Expand All @@ -18,6 +22,7 @@ class InternalApiToken {

friend class DatabaseTestPeer;
friend class Recovery;
friend struct test::ColumnInfo;
};

} // namespace sql
Expand Down
Loading

0 comments on commit 455989b

Please sign in to comment.