Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: Clean up sql::Database unit tests.
This CL performs the following cleanups. * SQLDatabaseTest.Rollback is deleted, because it's redundant with SQLTransactionTest.ExplicitRollback and SQLTransactionTest.NestedRollback. * SQLDatabaseTest.RazeLock is broken into SQLDatabaseTest.Raze_OtherConnectionHas{Read,Write}lock. * SQLDatabaseTest.RazeEmptyDB is renamed to EmptyDatabaseFile * SQLDatabaseTest.RazeAndClose and RazeAndClose_Diagostics are broken into RazeAndClose, RazeAndClose_{DeletesData, IsOpen, Reopen_NoChanges, OpenTransaction, Preload_NoCrash, DoesTableExist, IsSQLValid, Execute, GetUniqueStatement, GetCachedStatement, TransactionBegin} and Close_IsSQLValid. * RazeAndClose_Invalidates{Unique,Cached}Statement are added, based on the tests involving `valid_statement` in SQLDatabaseTest.Poison. * SQLDatabaseTest.Poison is broken into sub-tests that parallel the RazeAndClose_* tests. * SQLDatabaseTest.AttachDatabase{WithOpenTransaction} are cleaned up and ported away from sql::Database's direct transaction APIs. * The modified tests have their SQL statements updated to follow the SQL style guide. This CL is intended to give us better coverage around Database::RazeAndClose() and Database::Poison(), and start migrating away from Database::{Begin,Rollback,Commit}Transaction() APIs. Bug: 1310577, 1311718 Change-Id: I1c970988851dd098c0deddb297242e37f4654340 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3558074 Reviewed-by: Austin Sullivan <asully@chromium.org> Auto-Submit: Victor Costan <pwnall@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/main@{#987134}
- Loading branch information