mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-24 14:17:58 +03:00
Add a simple test case (and corresponding bugfix) for the virtual table xConnect and xDisconnect methods. (CVS 3214)
FossilOrigin-Name: b63dbc794795533f0bfd2d8e25633e6e3dea3ebd
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is creating and dropping virtual tables.
|
||||
#
|
||||
# $Id: vtab1.test,v 1.3 2006/06/12 11:24:38 danielk1977 Exp $
|
||||
# $Id: vtab1.test,v 1.4 2006/06/12 12:08:45 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -74,5 +74,25 @@ do_test vtab1-2.2 {
|
||||
2 c {} 0 {} 0 \
|
||||
]
|
||||
|
||||
# Test that the database can be unloaded. This should invoke
|
||||
# the xDisconnect() callback each of the two virtual tables - t1 and t2.
|
||||
do_test vtab1-2.3 {
|
||||
set echo_module [list]
|
||||
db close
|
||||
set echo_module
|
||||
} [list xDisconnect xDisconnect]
|
||||
|
||||
# Re-open the database. Check that the schema of the virtual
|
||||
# table is still correct.
|
||||
do_test vtab1-2.4 {
|
||||
sqlite3 db test.db
|
||||
register_echo_module [sqlite3_connection_pointer db]
|
||||
execsql { PRAGMA table_info(t2); }
|
||||
} [list \
|
||||
0 a {} 0 {} 0 \
|
||||
1 b {} 0 {} 0 \
|
||||
2 c {} 0 {} 0 \
|
||||
]
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user